import java.sql.*;
public class Connect {
public static void main(String argv[]) {
Connection con = null;
try {
// here is the JDBC URL for this database
String url = "jdbc:msql://athens.imaginary.com:1114/db_test";
// more on what the Statement and ResultSet classes do later
Statement stmt;
ResultSet rs;
// either pass this as a property, i.e.
// -Djdbc.drivers=com.imaginary.sql.msql.MsqlDriver
// or load it here like we are doing in this example
Class.forName("com.imaginary.sql.msql.MsqlDriver");
// here is where the connection is made
con = DriverManager.getConnection(url, "borg", "");
}
catch( SQLException e ) {
e.printStackTrace();
}
finally {
if( con != null ) {
try { con.close(); }
catch( Exception e ) { }
}
}
}
}