I continue to get a java.lang.NullPointerException error when trying to connect to an ODBC data source on my hetwork.
Obviously, the DriverManager if failing to get a Connection.
theODBCname data source on theServer.com requires no authentication.
Tried accessing theServer.com via its IP address.
Tried Class.forName with and without .newInstance()
This exact code with only the driver and database names changed works like a charm on a local mysql database.
In case it matters, theODBCname data source is a Foxpro flat file directory; this data source is used elsewhere on my network with no problem.
Forgive me, I am a Java n00b.
Code:
import java.sql.*;
...
Connection j = getDataConnection();
...
private static Connection getDataConnection() {
Connection con = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc://theServer.com/theODBCname";
con = DriverManager.getConnection(url);
} catch (Exception e) {
...
}
return con;
}
Obviously, the DriverManager if failing to get a Connection.
theODBCname data source on theServer.com requires no authentication.
Tried accessing theServer.com via its IP address.
Tried Class.forName with and without .newInstance()
This exact code with only the driver and database names changed works like a charm on a local mysql database.
In case it matters, theODBCname data source is a Foxpro flat file directory; this data source is used elsewhere on my network with no problem.
Forgive me, I am a Java n00b.