2

我的代码如下。它是一个将叶子添加到数据库的程序。我得到了 java 运行时环境检测到致命错误,我不明白为什么。我是Java新手,所以对此我很困惑。谁能告诉我为什么会这样?我也在放错误文件。我也尝试理解这一点,但找不到错误所在的位置。

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.lang.String;
import java.io.*;
import java.sql.*;

public class AddLeave extends JFrame implements ActionListener
{

JFrame frame;
JPanel panel,panel1;
JLabel empid,name1,name2,department,designation;
JTextField txtempid,txtname1,txtname2,txtdepartment,txtdesignation;
JButton find,ok,cancel;
String txtname1_1 = "";
String  txtname2_1 = "";
String  txtdepartment_1 = "";
String  txtdesignation_1 = "";
String  txtempid1="";   
Connection conn;

public AddLeave()
{
    frame=new JFrame("ADD LEAVE");
    frame.setLayout(new BorderLayout());
    panel=new JPanel();
    panel.setLayout(new GridLayout(5,2,5,5));
    panel.setBackground(Color.RED);

    panel1=new JPanel();
    //panel1.setLayout(new GridLayout(1,3,10,10));
    panel1.setBackground(Color.GREEN);

    empid=new JLabel("Employee Id:");
    name1=new JLabel("First Name:");
    name2=new JLabel("Last Name:");
    department=new JLabel("Department:");
    designation=new JLabel("Designation:");

    txtempid = new JTextField();
    txtname1 = new JTextField();
    txtname1.setEditable(false);
    txtname2 = new JTextField();
    txtname2.setEditable(false);
    txtdepartment = new JTextField();
    txtdesignation = new JTextField();
    txtdesignation.setEditable(false);

    find=new JButton("FIND");
    find.addActionListener(this);
    ok=new JButton("OK");
    ok.addActionListener(this);
    cancel=new JButton("CANCEL");
    cancel.addActionListener(this);


    panel.add(empid);
    panel.add(txtempid);
    panel.add(name1);
    panel.add(txtname1);
    panel.add(name2);
    panel.add(txtname2);
    panel.add(department);
    panel.add(txtdepartment);
    panel.add(designation);
    panel.add(txtdesignation);

    panel1.add(find);
    panel1.add(ok);
    panel1.add(cancel);

    frame.add(panel,BorderLayout.CENTER);
    frame.add(panel1,BorderLayout.SOUTH);
    frame.setVisible(true);
    frame.pack();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    connect();
}

public void connect()
{
    try
    {
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
             conn=DriverManager.getConnection("jdbc:odbc:demo","system","scott");

    }
    catch(Exception e)
    {
    System.out.println("Error : "+e);
    }
}

public void actionPerformed(ActionEvent event)
{
    Object source= event.getSource();
    if(source.equals(find))
    {
        find();
    }

    if(source.equals(ok))
    {
        System.out.println("Leave added");
    }
    if(source.equals(cancel))
    {
        System.out.println("Canceled");
    }
}

public void find()
{

    txtempid1=txtempid.getText();
    try
    {

        if(txtempid1.isEmpty())
        {
            JOptionPane.showMessageDialog(null,"ID REQUIRED!!!","warning",JOptionPane.WARNING_MESSAGE);

        }
        else
        {
            Statement stmt = conn.createStatement();
            String query = "SELECT * FROM demo WHERE empid='"+txtempid1+"'";
            ResultSet rs = stmt.executeQuery(query);
            int foundrec = 0;
            while (rs.next())
            {
                        txtname1_1 = rs.getString(2);
                txtname2_1 = rs.getString(3);
                txtdesignation_1 = rs.getString(4); 
                foundrec =foundrec+ 1;
            }
            if(foundrec==1)
            {
                JOptionPane.showMessageDialog(null,"**Record Found**"," Message",JOptionPane.PLAIN_MESSAGE);
                txtname1.setText(txtname1_1);
                txtname2.setText(txtname2_1); 
                txtdesignation.setText(txtdesignation_1); 

            }
            else
            {
            JOptionPane.showMessageDialog(null,"!!!!EMPLOYEE DOES NOT EXIST!!!!"," ERROR",JOptionPane.ERROR_MESSAGE);
            }
        }
        conn.close();   
    }
    catch(Exception e)
    {
        System.out.println("Error : "+e);
    }

}

public static void main(String[] args)
{
    new AddLeave();
}
}

这是错误文件

    #
    # Java 运行时环境检测到一个致命错误:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c901010, pid=3052, tid=3732
    #
    # JRE 版本:6.0_31-b05
    # Java VM:Java HotSpot(TM) Client VM(20.6-b01混合模式,共享windows-x86)
    # 有问题的框架:
    #C [ntdll.dll+0x1010]
    #
    # 如果您想提交错误报告,请访问:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # 崩溃发生在 Java 虚拟机之外的本地代码中。
    # 查看有问题的框架以了解报告错误的位置。
    #

    -  -  -  -  -  -  - - 线  -  -  -  -  -  -  - -

    当前线程 (0x03054400): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=3732, stack(0x03250000,0x032a0000)]

    siginfo:ExceptionCode=0xc0000005,读取地址0x00000018

    寄存器:
    EAX=0x00000004,EBX=0x329ab298,ECX=0x7ffad000,EDX=0x00000004
    ESP=0x0329ea48,EBP=0x0329ea60,ESI=0x00000000,EDI=0x03401590
    EIP=0x7c901010,EFLAGS=0x00010246

    栈顶:(sp=0x0329ea48)
    0x0329ea48: 74355a16 00000004 034015b4 7432139f
    0x0329ea58: 034015b4 03401590 0329ea70 74322c5d
    0x0329ea68: 034015b4 03054528 0329ea84 74325fa0
    0x0329ea78: 03401590 74350000 0329f1ac 0329eaa0
    0x0329ea88: 7432740e 03401590 0329eac0 00000003
    0x0329ea98: 0312cd28 03054528 0329eab8 6d36124e
    0x0329eaa8: 03401590 0329eac0 03054400 329ab298
    0x0329eab8: 0329eb04 00919fc7 00000000 0329eb20

    说明:(pc=0x7c901010)
    0x7c900ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x7c901000:90 90 90 90 90 64 8b 0d 18 00 00 00 8b 54 24 04
    0x7c901010:83 7a 14 00 75 4f f0 ff 42 04 75 19 8b 41 24 89
    0x7c901020:42 0c c7 42 08 01 00 00 00 33 c0 c2 04 00 8d a4


    注册到内存映射:

    EAX=0x00000004 是一个未知值
    EBX=0x329ab298 是一个循环
    {方法}
     - 类:{其他类}
    ECX=0x7ffad000 是未知值
    EDX=0x00000004 是一个未知值
    ESP=0x0329ea48 指向线程堆栈:0x03054400
    EBP=0x0329ea60 指向线程堆栈:0x03054400
    ESI=0x00000000 是未知值
    EDI=0x03401590 是未知值


    堆栈:[0x03250000,0x032a0000],sp=0x0329ea48,可用空间=314k
    本机帧:(J=编译的 Java 代码,j=解释的,Vv=VM 代码,C=本机代码)
    C [ntdll.dll+0x1010] RtlEnterCriticalSection+0xb
    C [ODBC32.dll+0x2c5d] MpHeapAlloc+0x452
    C [ODBC32.dll+0x5fa0] SQLSetStmtAttrW+0xfeb
    C [ODBC32.dll+0x740e] SQLAllocStmt+0x21
    C [JdbcOdbc.dll+0x124e] Java_sun_jdbc_odbc_JdbcOdbc_allocStmt+0x28
    j sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0
    j sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47
    j sun.jdbc.odbc.JdbcOdbcConnection.createStatement(II)Ljava/sql/Statement;+27
    j sun.jdbc.odbc.JdbcOdbcConnection.createStatement()Ljava/sql/Statement;+7
    j AddLeave.find()V+37
    j AddLeave.actionPerformed(Ljava/awt/event/ActionEvent;)V+17
    j javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+84
    j javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEvent;)V+5
    j javax.swing.DefaultButtonModel.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+35
    j javax.swing.DefaultButtonModel.setPressed(Z)V+117
    j javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Ljava/awt/event/MouseEvent;)V+35
    j java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+64
    j javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23
    j java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81
    j java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18
    j java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+570
    j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
    j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
    j java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/Mous eEvent;)V+320
    j java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z+139
    j java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50
    j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12
    j java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+65
    j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
    j java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+41
    j java.awt.EventQueue.access$000(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V+3
    j java.awt.EventQueue$1.run()Ljava/lang/Void;+12
    j java.awt.EventQueue$1.run()Ljava/lang/Object;+1
    v ~StubRoutines::call_stub
    V [jvm.dll+0xfac3b]
    V [jvm.dll+0x18c3a1]
    V [jvm.dll+0xfacbd]
    V [jvm.dll+0xbb654]
    C [java.dll+0x102f] Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2+0x17
    j java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Objec t;+28
    j java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+6
    j java.awt.EventQueue$2.run()Ljava/lang/Void;+11
    j java.awt.EventQueue$2.run()Ljava/lang/Object;+1
    v ~StubRoutines::call_stub
    V [jvm.dll+0xfac3b]
    V [jvm.dll+0x18c3a1]
    V [jvm.dll+0xfacbd]
    V [jvm.dll+0xbb654]
    C [java.dll+0x102f] Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_se curity_AccessControlContext_2+0x17
    j java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+28
    j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+73
    j java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z+204
    j java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
    j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
    j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
    j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
    j java.awt.EventDispatchThread.run()V+9
    v ~StubRoutines::call_stub
    V [jvm.dll+0xfac3b]
    V [jvm.dll+0x18c3a1]
    V [jvm.dll+0xfade1]
    V [jvm.dll+0xfae3b]
    V [jvm.dll+0xb5569]
    V [jvm.dll+0x118f14]
    V [jvm.dll+0x140ffc]
    C [msvcr71.dll+0x9565] endthreadex+0xa0
    C [kernel32.dll+0xb50b] GetModuleFileNameA+0x1b4

    Java 框架:(J=编译的 Java 代码,j=解释的,Vv=VM 代码)
    j sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0
    j sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47
    j sun.jdbc.odbc.JdbcOdbcConnection.createStatement(II)Ljava/sql/Statement;+27
    j sun.jdbc.odbc.JdbcOdbcConnection.createStatement()Ljava/sql/Statement;+7
    j AddLeave.find()V+37
    j AddLeave.actionPerformed(Ljava/awt/event/ActionEvent;)V+17
    j javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+84
    j javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEvent;)V+5
    j javax.swing.DefaultButtonModel.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+35
    j javax.swing.DefaultButtonModel.setPressed(Z)V+117
    j javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Ljava/awt/event/MouseEvent;)V+35
    j java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+64
    j javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23
    j java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81
    j java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18
    j java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+570
    j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
    j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
    j java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V+320
    j java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z+139
    j java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50
    j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12
    j java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+65
    j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
    j java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+41
    j java.awt.EventQueue.access$000(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V+3
    j java.awt.EventQueue$1.run()Ljava/lang/Void;+12
    j java.awt.EventQueue$1.run()Ljava/lang/Object;+1
    v ~StubRoutines::call_stub
    j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0
    j java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+28
    j java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+6
    j java.awt.EventQueue$2.run()Ljava/lang/Void;+11
    j java.awt.EventQueue$2.run()Ljava/lang/Object;+1
    v ~StubRoutines::call_stub
    j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0
    j java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+28
    j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+73
    j java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z+204
    j java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
    j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
    j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
    j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
    j java.awt.EventDispatchThread.run()V+9
    v ~StubRoutines::call_stub

    -  -  -  -  -  -  - - 过程  -  -  -  -  -  -  - -

    Java 线程:(=> 当前线程)
      0x0312dc00 JavaThread "TimerQueue" 守护进程 [_thread_blocked, id=3508, stack(0x03540000,0x03590000)]
      0x002a6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=3588, stack(0x008c0000,0x00910000)]
     0x0308f400 JavaThread“D3D 屏幕更新程序”守护进程 [_thread_blocked, id=3808, stack(0x03370000,0x033c0000)]
    => 0x03054400 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=3732, stack(0x03250000,0x032a0000)]
      0x02b8f800 JavaThread "AWT-Windows" 守护进程 [_thread_in_native, id=380, stack(0x02f90000,0x02fe0000)]
      0x02b8e400 JavaThread "AWT-Shutdown" [_thread_blocked, id=3368, stack(0x02f40000,0x02f90000)]
      0x02b8cc00 JavaThread "Java2D Disposer" 守护进程 [_thread_blocked, id=972, stack(0x02ef0000,0x02f40000)]
      0x02b48800 JavaThread“低内存检测器”守护进程 [_thread_blocked, id=1524, stack(0x02dc0000,0x02e10000)]
      0x02b43400 JavaThread "C1 CompilerThread0" 守护进程 [_thread_blocked, id=3272, stack(0x02d70000,0x02dc0000)]
      0x02b41000 JavaThread“附加侦听器”守护进程 [_thread_blocked, id=1364, stack(0x02d20000,0x02d70000)]
      0x02b3f800 JavaThread“信号调度程序”守护进程 [_thread_blocked, id=2804, stack(0x02cd0000,0x02d20000)]
      0x02b38400 JavaThread“终结器”守护进程 [_thread_blocked, id=3164, stack(0x02c80000,0x02cd0000)]
      0x02b36c00 JavaThread“引用处理程序”守护进程 [_thread_blocked, id=1656, stack(0x02c30000,0x02c80000)]

     其他主题:
      0x02afa000 VMThread [堆栈:0x02be0000,0x02c30000] [id=1988]
      0x02b4b400 WatcherThread [堆栈:0x02e10000,0x02e60000] [id=956]

     VM 状态:不在安全点(正常执行)

     VM Mutex/Monitor 当前由一个线程拥有:无

     堆
    def 新一代总 4928K,使用 2084K [0x22970000, 0x22ec0000, 0x27ec0000)
    伊甸园空间 4416K, 47% 已使用 [0x22970000, 0x22b791d8, 0x22dc0000)
    从空间 512K, 0% 使用 [0x22dc0000, 0x22dc0000, 0x22e40000)
     到空间 512K, 0% 已使用 [0x22e40000, 0x22e40000, 0x22ec0000)
    终身代总计 10944K,已使用 0K [0x27ec0000, 0x28970000, 0x32970000)
     空间 10944K, 0% 已使用 [0x27ec0000, 0x27ec0000, 0x27ec0200, 0x28970000)
     压缩 perm gen 总计 12288K,使用 764K [0x32970000, 0x33570000, 0x36970000)
     空间 12288K,已使用 6% [0x32970000, 0x32a2f0f0, 0x32a2f200, 0x33570000)
     ro 空间 10240K, 51% 已使用 [0x36970000, 0x36e9e318, 0x36e9e400, 0x37370000)
     rw 空间 12288K, 55% 已使用 [0x37370000, 0x37a0a088, 0x37a0a200, 0x37f70000)

    代码缓存 [0x00910000, 0x009b0000, 0x02910000)
     total_blobs=316 nmethods=92 适配器=160 free_code_cache=32927040 maximum_free_block=0

    动态库:
    0x00400000 - 0x00425000 C:\WINDOWS\system32\java.exe
    0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c8f4000 C:\WINDOWS\system32\kernel32.dll
    0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
    0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll
    0x7c340000 - 0x7c396000 C:\Program Files\Java\jre6\bin\msvcr71.dll
    0x6d7f0000 - 0x6da9f000 C:\Program Files\Java\jre6\bin\client\jvm.dll
    0x77d40000 - 0x77dd0000 C:\WINDOWS\system32\USER32.dll
     0x77f10000 - 0x77f56000 C:\WINDOWS\system32\GDI32.dll
    0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
    0x6d7a0000 - 0x6d7ac000 C:\Program Files\Java\jre6\bin\verify.dll
    0x6d320000 - 0x6d33f000 C:\Program Files\Java\jre6\bin\java.dll
    0x6d7e0000 - 0x6d7ef000 C:\Program Files\Java\jre6\bin\zip.dll
    0x6d000000 - 0x6d14c000 C:\Program Files\Java\jre6\bin\awt.dll
     0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV
    0x77c10000 - 0x77c68000 C:\WINDOWS\system32\msvcrt.dll
    0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.dll
    0x774e0000 - 0x7761c000 C:\WINDOWS\system32\ole32.dll
    0x773d0000 - 0x774d2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\COMCTL32.dll
    0x77f60000 - 0x77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
    0x5ad70000 - 0x5ada8000 C:\WINDOWS\system32\uxtheme.dll
    0x6d230000 - 0x6d27f000 C:\Program Files\Java\jre6\bin\fontmanager.dll
    0x74720000 - 0x7476b000 C:\WINDOWS\system32\MSCTF.dll
    0x4fdd0000 - 0x4ff76000 C:\WINDOWS\system32\d3d9.dll
    0x03020000 - 0x03026000 C:\WINDOWS\system32\d3d8thk.dll
    0x77c00000 - 0x77c08000 C:\WINDOWS\system32\VERSION.dll
    0x7c9c0000 - 0x7d1d4000 C:\WINDOWS\system32\shell32.dll
    0x6d600000 - 0x6d613000 C:\Program Files\Java\jre6\bin\net.dll
    0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
     0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
    0x6d620000 - 0x6d629000 C:\Program Files\Java\jre6\bin\nio.dll
    0x77120000 - 0x771ac000 C:\WINDOWS\system32\OLEAUT32.DLL
    0x6d360000 - 0x6d36d000 C:\Program Files\Java\jre6\bin\JdbcOdbc.dll
    0x74320000 - 0x7435d000 C:\WINDOWS\system32\ODBC32.dll
    0x763b0000 - 0x763f9000 C:\WINDOWS\system32\comdlg32.dll
    0x20000000 - 0x20017000 C:\WINDOWS\system32\odbcint.dll
    0x032e0000 - 0x032e5000 C:\WINDOWS\system32\msorc32r.dll
    0x10000000 - 0x10061000 C:\oracle\app\oracle\product\10.2.0\server\bin\oci.dll
    0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
    0x61c20000 - 0x61e73000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\ORACLIENT10.DLL
     0x60870000 - 0x60956000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oracore10.dll
     0x60a80000 - 0x60b46000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oranls10.dll
    0x63690000 - 0x636a8000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oraunls10.dll
    0x60eb0000 - 0x60eb7000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orauts.dll
    0x636b0000 - 0x636b6000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oravsn10.dll
     0x60fa0000 - 0x61092000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oracommon10.dll
    0x60300000 - 0x60858000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orageneric10.dll
    0x63430000 - 0x63457000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orasnls10.dll
    0x035a0000 - 0x0372c000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oraxml10.dll
    0x03730000 - 0x03741000 C:\WINDOWS\system32\MSVCIRT.dll
    0x60960000 - 0x60a6d000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oran10.dll
    0x62740000 - 0x6277d000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oranl10.dll
    0x62790000 - 0x627a7000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oranldap10.dll
    0x627f0000 - 0x628f9000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orannzsbb10.dll
    0x62530000 - 0x62583000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oraldapclnt10.dll
    0x62670000 - 0x6268b000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orancrypt10.dll
    0x71ad0000 - 0x71ad9000 C:\WINDOWS\system32\WSOCK32.dll
    0x62920000 - 0x6296c000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oranro10.dll
    0x626b0000 - 0x626b7000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oranhost10.dll
    0x62660000 - 0x62666000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orancds10.dll
    0x629c0000 - 0x629c8000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orantns10.dll
    0x60b50000 - 0x60ea9000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orapls10.dll
    0x63420000 - 0x63429000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oraslax10.dll
    0x63080000 - 0x63284000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oraplp10.dll
    0x61ed0000 - 0x61f5b000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orahasgen10.dll
    0x62ab0000 - 0x62b1a000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oraocr10.dll
    0x62b20000 - 0x62b60000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oraocrb10.dll
    0x5b860000 - 0x5b8b4000 C:\WINDOWS\system32\NETAPI32.dll
    0x62980000 - 0x62990000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orantcp10.dll
    0x63520000 - 0x635ba000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\orasql10.dll
    0x5fe80000 - 0x5fe9b000 C:\WINDOWS\system32\odbccp32.dll
    0x77fe0000 - 0x77ff1000 C:\WINDOWS\system32\Secur32.dll
    0x62650000 - 0x62659000 C:\oraclexe\app\oracle\product\10.2.0\server\bin\oranbeq10.dll
    0x71f80000 - 0x71f84000 C:\WINDOWS\system32\security.dll
    0x77c70000 - 0x77c93000 C:\WINDOWS\system32\msv1_0.dll
     0x76d60000 - 0x76d79000 C:\WINDOWS\system32\iphlpapi.dll

    虚拟机参数:
     java_command: AddLeave
     启动器类型:SUN_STANDARD

     环境变量:
     类路径=。
   PATH=C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WIN DOWS\System32\Wbem;C:\Program Files\Java \jdk1.6.0\bin;C:\Program Files\Common Files\Nero\Lib\
    用户名=苏南达
    操作系统=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 13, GenuineIntel


    -  -  -  -  -  -  - - 系统  -  -  -  -  -  -  - -

     操作系统:Windows XP Build 2600 Service Pack 2

     CPU:共 2 个(每个 cpu 2 个内核,每个内核 1 个线程)系列 6 型号 15 步进 13、cmov、cx8、fxsr、mmx、sse、sse2、sse3、ssse3

    内存:4k 页,物理 1045684k(346004k 空闲),交换 2517544k(1203440k 空闲)

    vm_info:适用于 windows-x86 JRE (1.6.0_31-b05) 的 Java HotSpot(TM) 客户端 VM (20.6-b01),由“java_re”和 MS VC++ 7.1 (VS2003) 于 2012 年 2 月 3 日 18:44:09 构建

    时间:2012年4月8日星期日15:46:59
    经过时间:9秒

“Demo”是数据库的名称,它有 4 列,即 empid,Fname,Lname,designation。该程序的工作原理是,当我输入员工 ID 时,它会从数据库中检索剩余数据。由于我没有添加部门 ID 列,因此我没有从数据库中获取该列。

4

2 回答 2

1

您应该使用适合您的 Oracle 数据库版本的Oracle JDBC 驱动程序;这些通常是纯 Java。JDBC-ODBC 桥驱动程序有很大的限制,包括 JNI 依赖性。

于 2012-04-08T14:26:35.673 回答
1

当 JNI( Java 本地接口)代码出现问题时,我通常会看到这些错误,即这里,可能是 JDBC(Java 数据库连接)驱动程序ODBC32.dll。您确定为您的平台使用正确版本的 JDBC 驱动程序吗?尤其要检查您在 32 位操作系统(操作系统)上使用的是 32 位版本,而不是 64 位版本(反之亦然)。

The crash happened outside the Java Virtual Machine in native code.

于 2012-04-08T11:07:37.233 回答