http://www.homeandlearn.co.uk/java/connecting_to_a_database_table.html
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package smallDatabase_console;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
*
* @author backup
*/
public class JavaDB {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
try{
String host = "jdbc:derby://localhost:1527/ForexSignalsNew ";
String uName="riyo";
String uPass="iw123456";
Connection con=DriverManager.getConnection(host,uName,uPass);
}
catch(SQLException err )
{
System.out.println(err.getMessage());
}
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package smallDatabase_console;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
*
* @author backup
*/
public class JavaDB {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
try{
String host = "jdbc:derby://localhost:1527/ForexSignalsNew ";
String uName="riyo";
String uPass="iw123456";
Connection con=DriverManager.getConnection(host,uName,uPass);
}
catch(SQLException err )
{
System.out.println(err.getMessage());
}
}
}
No comments:
Post a Comment