使用websphere带的J2RE 1.4.1 IBM Windows 32 build cn1411-20031011,运行application,连接access出错!!!!
shw3 2005-03-30 02:34:43 如题。。
代码如下:
//取得连接
try{
String strurl="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=database/statute.mdb";
common.WriterLog("ForName!!!!");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
common.WriterLog("ForName");
Connection conn=DriverManager.getConnection(strurl) ;
common.WriterLog("Connection");
return conn;
}catch(Exception e){
common.WriterLog("getConnection"+e);
return null;}
}
后台打印:
[ 2005-03-30 14:32:49 ] SystemOut o ForName!!!!
[ 2005-03-30 14:32:49 ] SystemOut o ForName
[ 2005-03-30 14:32:49 ] SystemOut o getConnectionjava.lang.NullPointerException