如题。。
代码如下:
//取得连接
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
代码如下:
//取得连接
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
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货