有谁知道ERROR:JDWP Unable to get JNI 1.2 environment ,jvm
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn=DriverManager.getConnection("jdbc:odbc:driver={Microsoft Access Driver (*.mdb);DBQ=d:/test.mdb"); Statement stmt=conn.createStatement(); int n=stmt.executeUpdate("insert into test (userName,userPwd) values('xpice','123456')"); System.out.println("n=" + n); }catch(ClassNotFoundException e) { System.out.println(e.getMessage() ); }catch(SQLException e) { System.out.println(e.getMessage() ); } 运行后n=1 但是Access 没有更新 如果加上 这句ResultSet rs=stmt.executeQuery("select * from test");的话添加会成功!但为什么会这样呢? 但调试后得出的错误是: ERROR:JDWP Unable to get JNI 1.2 environment ,jvm-> GetEvn() return =-2 JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):[../../../src/share/back/until.c:820]事物没有提交的原因? 写上commit试试Create By Any-Extract(WL-AE)
(阅读次数:)
|