您的位置:程序门 -> java -> eclipse



java连接access出出问题?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


java连接access出出问题?[无满意答案结贴]
发表于:2008-01-09 10:46:15 楼主
drivername="sun.jdbc.odbc.jdbcodbcdriver";
dburl="jdbc:odbc:driver={microsoft   access   driver   (*.mdb)};dbq=d:/test.mdb";
class.forname(drivername);
dbconn   =   drivermanager.getconnection(dburl);
出问题,而且程序一下就跳出。access是2003,没有设置odbc,不通过dsn。
错误如下:
an   unexpected   exception   has   been   detected   in   native   code   outside   the   vm.
unexpected   signal   :   exception_priv_instruction   (0xc0000096)   occurred   at   pc=0x4b8a0000
function=sqlgetfunctions+0xf8f
library=d:\windows\system32\odbcjt32.dll

current   java   thread:
at   sun.jdbc.odbc.jdbcodbc.driverconnect(native   method)
at   sun.jdbc.odbc.jdbcodbc.sqldriverconnect(unknown   source)
at   sun.jdbc.odbc.jdbcodbcconnection.initialize(unknown   source)
at   sun.jdbc.odbc.jdbcodbcdriver.connect(unknown   source)
-   locked   <0x10026848>   (a   sun.jdbc.odbc.jdbcodbcdriver)
at   java.sql.drivermanager.getconnection(unknown   source)
-   locked   <0x145790d0>   (a   java.lang.class)
at   java.sql.drivermanager.getconnection(unknown   source)
-   locked   <0x145790d0>   (a   java.lang.class)
at   ui.fromdb.displayaccesstables(fromdb.java:481)
at   ui.fromdb.actionperformed(fromdb.java:511)
at   javax.swing.abstractbutton.fireactionperformed(unknown   source)
at   javax.swing.abstractbutton$forwardactionevents.actionperformed(unknown   source)
at   javax.swing.defaultbuttonmodel.fireactionperformed(unknown   source)
at   javax.swing.defaultbuttonmodel.setpressed(unknown   source)
at   javax.swing.plaf.basic.basicbuttonlistener.mousereleased(unknown   source)
at   java.awt.component.processmouseevent(unknown   source)
at   java.awt.component.processevent(unknown   source)
at   java.awt.container.processevent(unknown   source)
at   java.awt.component.dispatcheventimpl(unknown   source)
at   java.awt.container.dispatcheventimpl(unknown   source)
at   java.awt.component.dispatchevent(unknown   source)
at   java.awt.lightweightdispatcher.retargetmouseevent(unknown   source)
at   java.awt.lightweightdispatcher.processmouseevent(unknown   source)
at   java.awt.lightweightdispatcher.dispatchevent(unknown   source)
at   java.awt.container.dispatcheventimpl(unknown   source)
at   java.awt.window.dispatcheventimpl(unknown   source)
at   java.awt.component.dispatchevent(unknown   source)
at   java.awt.eventqueue.dispatchevent(unknown   source)
at   java.awt.eventdispatchthread.pumponeeventforhierarchy(unknown   source)
at   java.awt.eventdispatchthread.pumpeventsforhierarchy(unknown   source)
at   java.awt.eventdispatchthread.pumpevents(unknown   source)
at   java.awt.eventdispatchthread.pumpevents(unknown   source)
at   java.awt.eventdispatchthread.run(unknown   source)

dynamic   libraries:
0x00400000   -   0x0040b000   d:\program   files\java\j2re1.4.2_08\bin\javaw.exe
0x7c930000   -   0x7ca00000   d:\windows\system32\ntdll.dll
0x7c800000   -   0x7c92b000   d:\windows\system32\kernel32.dll
0x77f30000   -   0x77fdb000   d:\windows\system32\advapi32.dll
0x77c20000   -   0x77cbf000   d:\windows\system32\rpcrt4.dll
0x76eb0000   -   0x76ec3000   d:\windows\system32\secur32.dll
0x77e10000   -   0x77ea0000   d:\windows\system32\user32.dll
0x77bd0000   -   0x77c18000   d:\windows\system32\gdi32.dll
0x77b70000   -   0x77bca000   d:\windows\system32\msvcrt.dll
0x76180000   -   0x7619d000   d:\windows\system32\imm32.dll
0x7f000000   -   0x7f009000   d:\windows\system32\lpk.dll
0x737e0000   -   0x738b0000   d:\windows\system32\d3dim700.dll
0x74430000   -   0x74480000   d:\windows\system32\msctf.dll
0x75d60000   -   0x75d87000   d:\windows\system32\apphelp.dll
0x4c510000   -   0x4c53e000   d:\windows\system32\msctfime.ime
0x03520000   -   0x0352c000   d:\program   files\java\j2re1.4.2_08\bin\jdbcodbc.dll
0x4b750000   -   0x4b78d000   d:\windows\system32\odbc32.dll
0x77370000   -   0x77407000   d:\windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.3790.3959_x-ww_78fcf8d0\comctl32.dll
0x7ca10000   -   0x7d1ec000   d:\windows\system32\shell32.dll
0x4ebc0000   -   0x4ebda000   d:\windows\system32\odbccp32.dll
0x77b60000   -   0x77b68000   d:\windows\system32\version.dll
0x76b70000   -   0x76b98000   d:\windows\system32\imagehlp.dll
0x6d830000   -   0x6d8d8000   d:\windows\system32\dbghelp.dll
0x76ab0000   -   0x76abb000   d:\windows\system32\psapi.dll

heap   at   vm   abort:
heap
  def   new   generation       total   576k,   used   102k   [0x10010000,   0x100b0000,   0x104f0000)
    eden   space   512k,     19%   used   [0x10010000,   0x100298f8,   0x10090000)
    from   space   64k,       0%   used   [0x100a0000,   0x100a0000,   0x100b0000)
    to       space   64k,       0%   used   [0x10090000,   0x10090000,   0x100a0000)
  tenured   generation       total   2748k,   used   1869k   [0x104f0000,   0x1079f000,   0x14010000)
      the   space   2748k,     68%   used   [0x104f0000,   0x106c3430,   0x106c3600,   0x1079f000)
  compacting   perm   gen     total   5888k,   used   5644k   [0x14010000,   0x145d0000,   0x18010000)
      the   space   5888k,     95%   used   [0x14010000,   0x14593008,   0x14593200,   0x145d0000)

local   time   =   wed   jan   09   10:43:44   2008
elapsed   time   =   2
发表于:2008-01-09 11:41:281楼 得分:0
我水平有限,按你这写法没设odbc我还真不知道怎么办了,用的odbc协议就必须设odbc


快速检索

最新资讯
热门点击