jimwal0367
Programmer
Not sure if this is the right forum, I need to connect to my sql database using java. I cannot seem to get the jdbc drivers to load. Does anybody have any ideas, here is the code so far.
// Establish a connection to an Interbase database using JDBC.
import java.sql.*;
class DbConnect {
public static void main (String[] args) {
try {
// Step 1: Load the JDBC driver.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Step 2: Establish the connection to the database.
String url = "Server Name";
Connection conn = DriverManager.getConnection(url,"user1","password");
} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
}
}
}
jimwal0367
// Establish a connection to an Interbase database using JDBC.
import java.sql.*;
class DbConnect {
public static void main (String[] args) {
try {
// Step 1: Load the JDBC driver.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Step 2: Establish the connection to the database.
String url = "Server Name";
Connection conn = DriverManager.getConnection(url,"user1","password");
} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
}
}
}
jimwal0367