package mydatabase;
import java.sql.*;
/**
*
* @author user
*/
public class ClassFun {
public Connection con=null;
public Statement smt=null;
public ResultSet res=null;
public void Connect()
{
try
{
Class.forName("org.apache.derby.jdbc.ClientDriver");
}
catch(java.lang.ClassNotFoundException e)
{
System.err.println( e.getMessage());
}
try
{
con = DriverManager.getConnection("jdbc:derby://localhost:1527/student","username","password");
}
catch(SQLException e)
{
System.err.println(e.getMessage());
}
}
}
import java.sql.*;
/**
*
* @author user
*/
public class ClassFun {
public Connection con=null;
public Statement smt=null;
public ResultSet res=null;
public void Connect()
{
try
{
Class.forName("org.apache.derby.jdbc.ClientDriver");
}
catch(java.lang.ClassNotFoundException e)
{
System.err.println( e.getMessage());
}
try
{
con = DriverManager.getConnection("jdbc:derby://localhost:1527/student","username","password");
}
catch(SQLException e)
{
System.err.println(e.getMessage());
}
}
}
No comments:
Post a Comment