RuntimeException while calling DriverManager.getConnection()

While trying to open my H2 database recently, I've run into an
exception that hasn't been happening in the past. The only thing I
can think of that has changed is that I moved the database from a
networked PC to my development PC, but I know that the connection has
worked since I made the move.
What is happening is that when I make the following call:
DriverManager.getConnection ("jdbc:h2:file:///C:/PECImageSearchDB/PECImageSearchDB;TRACE_LEVEL_FILE=0;TRACE_LEVEL_SYSTEM_OUT=0");
I get the following Exception:
org.h2.jdbc.JdbcSQLException: General error: java.lang.RuntimeException: file utils error: C:\PECImageSearchDB\PECImageSearchDB does not start with C:\PECImageSearchDB/[50000-118]
I have moved the database back to the networked PC in the original location and I am getting the same error except with the new driver letter (E:) replacing the C:.

It's seems to be a bug, but not sure, it was just a quick check. Try to read this.

Similar Messages

  • Core Dump when calling DriverManager.getConnection

    I'm very confused and hope someone can help me out with this.
    I'm trying to make a connection to a MS SQL Server 7 and am getting a core dump when getConnection is called. No exception is thrown, just a core dump and locked session. If I run the class from it's main there is absolutly no problem, but when I do a new on the class and call it's member to establish the connection: core dump. The environment is the same in both cases. The calling class did does use a mySql connection, but I tried closing it and setting it to null with the same problem. I'm not sure if the getConnection is stepping on a socket or what it's trying to violate in memory causing the dump. This is running on a SCO Openserver 5.0.5 box (green threads). Why it runs stand-alone and not when called from another class has got me tangled... Thread problem? I've tried several SQL drivers, they all do the same thing.
    Anyway, here's a snippet from the java class:
    try
    {Class.forName(myForName);
    // core dump, next line
    Connection myConn = DriverManager.getConnection(myUrl, myUser, myPass);
    // never get's here
    Statement myStmt = myConn.createStatement();
    catch (Exception e) // modified for this post
    {system.out.println(e.toString());
    Here's the dump printed to the monitor (2>&1)
    SIGSEGV 11* segmentation violation
    si_signo [11]: SIGSEGV 11* segmentation violation
    si_errno [0]: Error 0
    si_code [1]: SEGV_MAPERR [addr: 0x8]
         stackpointer=81adc820
    Full thread dump Classic VM (SCO-JDK-1.2.2-001:2000-Feb-17-03:54, green threads):
    "Thread-0" (TID:0x8074f3c8, sys_thread_t:0x83ae258, state:R) prio=5
         at com.inet.tds.TdsDriver.run(Unknown Source)
         at java.lang.Thread.run(Thread.java, Compiled Code)
    "process reaper" (TID:0x807431d0, sys_thread_t:0x82cd980, state:CW) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.UNIXProcess.run(Native Method)
         at java.lang.Thread.run(Thread.java, Compiled Code)
    "Finalizer" (TID:0x8071f320, sys_thread_t:0x808e478, state:CW) prio=8
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:174)
    "Reference Handler" (TID:0x8071f3b0, sys_thread_t:0x808a2d8, state:CW) prio=10
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java, Compiled Code)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:114)
    "Signal dispatcher" (TID:0x8071f3e0, sys_thread_t:0x80845a8, state:CW) prio=5
    "main" (TID:0x8071f1e0, sys_thread_t:0x804c2d8, state:R) prio=5
         at java.lang.Thread.sleep(Native Method)
         at com.inet.tds.TdsDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code)
         at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code)
         at SLSCorpRpt.printSchedule(SLSCorpRpt.java, Compiled Code)
         at SLSSchedule.runSchedule(SLSSchedule.java, Compiled Code)
         at SLSTextMain.<init>(SLSTextMain.java, Compiled Code)
         at SLSTextMain.main(SLSTextMain.java, Compiled Code)
    Monitor Cache Dump:
    java.lang.Object@807431A8/807C6140: <unowned>
         Waiting to be notified:
         "process reaper" (0x82cd980)
    java.lang.Class@80736EF8/807970A8: owner "main" (0x804c2d8) 2 entries
    <unknown key> (0x80737c21): owner "Thread-0" (0x83ae258) 1 entry
    java.lang.ref.ReferenceQueue$Lock@8071F338/80754D60: <unowned>
         Waiting to be notified:
         "Finalizer" (0x808e478)
    java.lang.ref.Reference$Lock@8071F3C0/80754890: <unowned>
         Waiting to be notified:
         "Reference Handler" (0x808a2d8)
    Registered Monitor Dump:
    PCMap lock: <unowned>
    utf8 hash table: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: owner "Thread-0" (0x83ae258) 1 entry
    Class linking lock: <unowned>
    System class loader lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Monitor cache lock: owner "Thread-0" (0x83ae258) 1 entry
    Monitor IO lock: <unowned>
    User signal monitor: <unowned>
         Waiting to be notified:
         "Signal dispatcher" (0x80845a8)
    Child death monitor: <unowned>
    I/O monitor: <unowned>
    Alarm monitor: <unowned>
         Waiting to be notified:
         <unknown thread> (0x804be18)
    Thread queue lock: owner "Thread-0" (0x83ae258) 1 entry
    Monitor registry: owner "Thread-0" (0x83ae258) 1 entry
    SIGABRT 6* abort (generated by abort(3) routine)
         stackpointer=81adc820
    Full thread dump Classic VM (SCO-JDK-1.2.2-001:2000-Feb-17-03:54, green threads):
    "Thread-0" (TID:0x8074f3c8, sys_thread_t:0x83ae258, state:R) prio=5
         at com.inet.tds.TdsDriver.run(Unknown Source)
         at java.lang.Thread.run(Thread.java, Compiled Code)
    "process reaper" (TID:0x807431d0, sys_thread_t:0x82cd980, state:CW) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.UNIXProcess.run(Native Method)
         at java.lang.Thread.run(Thread.java, Compiled Code)
    "Finalizer" (TID:0x8071f320, sys_thread_t:0x808e478, state:CW) prio=8
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:174)
    "Reference Handler" (TID:0x8071f3b0, sys_thread_t:0x808a2d8, state:CW) prio=10
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java, Compiled Code)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:114)
    "Signal dispatcher" (TID:0x8071f3e0, sys_thread_t:0x80845a8, state:CW) prio=5
    "main" (TID:0x8071f1e0, sys_thread_t:0x804c2d8, state:R) prio=5
         at java.lang.Thread.sleep(Native Method)
         at com.inet.tds.TdsDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code)
         at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code)
         at SLSCorpRpt.printSchedule(SLSCorpRpt.java, Compiled Code)
         at SLSSchedule.runSchedule(SLSSchedule.java, Compiled Code)
         at SLSTextMain.<init>(SLSTextMain.java, Compiled Code)
         at SLSTextMain.main(SLSTextMain.java, Compiled Code)
    Monitor Cache Dump:
    java.lang.Object@807431A8/807C6140: <unowned>
         Waiting to be notified:
         "process reaper" (0x82cd980)
    java.lang.Class@80736EF8/807970A8: owner "main" (0x804c2d8) 2 entries
    <unknown key> (0x80737c21): owner "Thread-0" (0x83ae258) 1 entry
    java.lang.ref.ReferenceQueue$Lock@8071F338/80754D60: <unowned>
         Waiting to be notified:
         "Finalizer" (0x808e478)
    java.lang.ref.Reference$Lock@8071F3C0/80754890: <unowned>
         Waiting to be notified:
         "Reference Handler" (0x808a2d8)
    Registered Monitor Dump:
    PCMap lock: <unowned>
    utf8 hash table: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: owner "Thread-0" (0x83ae258) 1 entry
    Class linking lock: <unowned>
    System class loader lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Monitor cache lock: owner "Thread-0" (0x83ae258) 1 entry
    Monitor IO lock: <unowned>
    User signal monitor: <unowned>
         Waiting to be notified:
         "Signal dispatcher" (0x80845a8)
    Child death monitor: <unowned>
    I/O monitor: <unowned>
    Alarm monitor: <unowned>
         Waiting to be notified:
         <unknown thread> (0x804be18)
    Thread queue lock: owner "Thread-0" (0x83ae258) 1 entry
    Monitor registry: owner "Thread-0" (0x83ae258) 1 entry

    I have a similar problem with establishing a connection through JNI. Have you resolved your problem?
    Here's mine.
    In java, I have a class that provides an interface to a mysql database. The java programs that call this interface work fine.
    When I try to call the java interface from C++ through JNI, I get the following output -- some debug statements sprinkled through also. I am assuming that the JVM is missing something at runtime that is there in my JRE. The classpaths match , etc. Exception handling in java and in JNI code are not providing any more detail.. Thanks for comments!!
    Created jvm
    Got KBModel and String classes
    KBModel.java:stest()
    KBModel.java:init(String)
    KBModel.java:init(String) - got Properties file
    Got DBDRIVER class: org.gjt.mm.mysql.Driver
    Object = class org.gjt.mm.mysql.Driver
    init(): DBURLSTRING = jdbc:mysql://sturgeon.xxx.com:3306/<valid db name>
    init(): DBUSER = <valid user>
    init(): DBPASSWORD =<valid password>
    KBModel.java:init(Properties) - Attempting connection
    init(): Drivers available:
    com.mysql.jdbc.Driver
    Driver accepts this URL
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 11 occurred at PC=0x4053ea09
    Function name=(N/A)
    Library=/lib/i686/libc.so.6
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Dynamic libraries:
    08048000-0804a000 r-xp 00000000 03:02 279279 /home/kathy/cm/src/Onto/Tools/Annotator/src/test/invokeKB
    0804a000-0804b000 rw-p 00001000 03:02 279279 /home/kathy/cm/src/Onto/Tools/Annotator/src/test/invokeKB
    40000000-40016000 r-xp 00000000 03:02 2093075 /lib/ld-2.2.4.so
    40016000-40017000 rw-p 00015000 03:02 2093075 /lib/ld-2.2.4.so
    40017000-40020000 r-xp 00000000 03:02 1309343 /usr/java/jdk1.3.1_03/jre/lib/i386/native_threads/libhpi.so
    40020000-40021000 rw-p 00008000 03:02 1309343 /usr/java/jdk1.3.1_03/jre/lib/i386/native_threads/libhpi.so
    40031000-40032000 r--p 00000000 03:02 768548 /usr/lib/locale/en_US/LC_IDENTIFICATION
    40033000-40085000 r-xp 00000000 03:02 328384 /usr/lib/libodbc.so.1.0.0
    40085000-40088000 rw-p 00051000 03:02 328384 /usr/lib/libodbc.so.1.0.0
    40088000-400c1000 r-xp 00000000 03:02 327275 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so
    400c1000-400c8000 rw-p 00038000 03:02 327275 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so
    400ca000-400eb000 r-xp 00000000 03:02 246620 /usr/java/jdk1.3.1_03/jre/lib/i386/libjava.so
    400eb000-400ed000 rw-p 00020000 03:02 246620 /usr/java/jdk1.3.1_03/jre/lib/i386/libjava.so
    400ee000-400ff000 r-xp 00000000 03:02 246629 /usr/java/jdk1.3.1_03/jre/lib/i386/libverify.so
    400ff000-40101000 rw-p 00010000 03:02 246629 /usr/java/jdk1.3.1_03/jre/lib/i386/libverify.so
    40101000-402f1000 r-xp 00000000 03:02 1701922 /usr/java/jdk1.3.1_03/jre/lib/i386/client/libjvm.so
    402f1000-403f1000 rw-p 001ef000 03:02 1701922 /usr/java/jdk1.3.1_03/jre/lib/i386/client/libjvm.so
    40408000-4053c000 r-xp 00000000 03:02 2093084 /lib/libc-2.2.4.so
    4053c000-40542000 rw-p 00133000 03:02 2093084 /lib/libc-2.2.4.so
    40547000-4054a000 r-xp 00000000 03:02 2093088 /lib/libdl-2.2.4.so
    4054a000-4054b000 rw-p 00002000 03:02 2093088 /lib/libdl-2.2.4.so
    4054b000-40558000 r-xp 00000000 03:02 343415 /lib/i686/libpthread-0.9.so
    40558000-40560000 rw-p 0000c000 03:02 343415 /lib/i686/libpthread-0.9.so
    40560000-40582000 r-xp 00000000 03:02 343413 /lib/i686/libm-2.2.4.so
    40582000-40583000 rw-p 00021000 03:02 343413 /lib/i686/libm-2.2.4.so
    40583000-40596000 r-xp 00000000 03:02 2093093 /lib/libnsl-2.2.4.so
    40596000-40597000 rw-p 00012000 03:02 2093093 /lib/libnsl-2.2.4.so
    40599000-405cd000 r-xp 00000000 03:02 328243 /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
    405cd000-405d9000 rw-p 00033000 03:02 328243 /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
    405dc000-405f0000 r-xp 00000000 03:02 246630 /usr/java/jdk1.3.1_03/jre/lib/i386/libzip.so
    405f0000-405f3000 rw-p 00013000 03:02 246630 /usr/java/jdk1.3.1_03/jre/lib/i386/libzip.so
    405f3000-41327000 r--s 00000000 03:02 1717328 /usr/java/jdk1.3.1_03/jre/lib/rt.jar
    41354000-4164b000 r--s 00000000 03:02 1717321 /usr/java/jdk1.3.1_03/jre/lib/i18n.jar
    4164b000-41661000 r--s 00000000 03:02 1717329 /usr/java/jdk1.3.1_03/jre/lib/sunrsasign.jar
    43709000-4370a000 r--p 00000000 03:02 408823 /usr/lib/locale/en_US/LC_MEASUREMENT
    4370a000-4370b000 r--p 00000000 03:02 2158478 /usr/lib/locale/en_US/LC_TELEPHONE
    4370b000-4370c000 r--p 00000000 03:02 2158480 /usr/lib/locale/en_US/LC_ADDRESS
    4370c000-4370d000 r--p 00000000 03:02 2158479 /usr/lib/locale/en_US/LC_NAME
    4370d000-4370e000 r--p 00000000 03:02 1864168 /usr/lib/locale/en_US/LC_PAPER
    4370e000-4370f000 r--p 00000000 03:02 2174846 /usr/lib/locale/en_US/LC_MESSAGES/SYS_LC_MESSAGES
    4370f000-43710000 r--p 00000000 03:02 408822 /usr/lib/locale/en_US/LC_MONETARY
    49d5f000-49d8a000 r--p 00000000 03:02 572342 /usr/lib/locale/en_US/LC_CTYPE
    49d8a000-49d90000 r--p 00000000 03:02 866674 /usr/lib/locale/en_US/LC_COLLATE
    49d90000-49d91000 r--p 00000000 03:02 768549 /usr/lib/locale/en_US/LC_TIME
    49d91000-49d92000 r--p 00000000 03:02 572338 /usr/lib/locale/en_US/LC_NUMERIC
    49d93000-49d9c000 r-xp 00000000 03:02 246627 /usr/java/jdk1.3.1_03/jre/lib/i386/libnet.so
    49d9c000-49d9d000 rw-p 00008000 03:02 246627 /usr/java/jdk1.3.1_03/jre/lib/i386/libnet.so
    49d9d000-49da7000 r-xp 00000000 03:02 2093117 /lib/libnss_nisplus-2.2.4.so
    49da7000-49da8000 rw-p 00009000 03:02 2093117 /lib/libnss_nisplus-2.2.4.so
    49da8000-49dab000 r-xp 00000000 03:02 2093106 /lib/libnss_dns-2.2.4.so
    49dab000-49dac000 rw-p 00002000 03:02 2093106 /lib/libnss_dns-2.2.4.so
    49dad000-49db7000 r-xp 00000000 03:02 2093109 /lib/libnss_files-2.2.4.so
    49db7000-49db8000 rw-p 00009000 03:02 2093109 /lib/libnss_files-2.2.4.so
    4a624000-4a67a000 r--s 00000000 03:02 540401 /usr/java/jdk1.3.1_03/jre/lib/ext/log4j-1.2.6.jar
    4a695000-4a6a3000 r-xp 00000000 03:02 2093122 /lib/libresolv-2.2.4.so
    4a6a3000-4a6a5000 rw-p 0000d000 03:02 2093122 /lib/libresolv-2.2.4.so
    Local Time = Thu Feb 13 13:35:05 2003
    Elapsed Time = 1
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.3.1_03-b03 mixed mode)
    # An error report file has been saved as hs_err_pid9210.log.
    # Please refer to the file for further information.
    #

  • 17008 Closed Connection on DriverManager.getConnection

    I am trying to connect with oci jdbc using the 9.2.0.1.0 client. Using -classpath %ORACLE_HOME%\jdbc\lib\ojdbc14.jar, and -Djava.library.path=%ORACLE_HOME%\bin. I am getting the error 17008 "Closed Connection" when I call DriverManager.getConnection. This code works perfectly well when using the thin driver. It's just the oci driver. I turned on DriverManager tracing, and got the stack trace below, anyone have any ideas what's wrong?
    DriverManager.getConnection("jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.10)(PORT=1521)))(CONNECT_DATA
    =(SID=bogus)))")
    trying driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@174d93a]
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2348)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:477)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at com.primavera.infr.admin.CfgAccessMgr.createDBConnection(CfgAccessMgr.java:119)
    at com.primavera.infr.admin.CfgAccessMgr.<init>(CfgAccessMgr.java:104)
    at com.primavera.console.cfg.admintool.SetupInfoFrame.actionPerformed(SetupInfoFrame.java:913)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    getConnection failed: java.sql.SQLException: Closed Connection

    DriverManager.getConnection("jdbc:oracle:oci:@(DESCRIP
    TION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.
    10.10)(PORT=1521)))(CONNECT_DATA
    =(SID=bogus)))")
    trying
    driver[className=oracle.jdbc.driver.OracleDriver,oracl
    e.jdbc.driver.OracleDriver@174d93a]
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed ConnectionI checked on the OTN website... to use OCI you need to have an Oracle client installation. Better stick to thin.
    Richard.

  • Which application is making "DriverManager.getConnection(URL,p)" call?

    Hi All,
    I have 15 domains each having 100 or more applications[.ear,.jar,.war] on a single Solaris box[Dev Env].
    One of these applications[out of 100*15] of one domain[out 15] is making direct JDBC connection.[DriverManager.getConnection(URL,p)]. Now the issue is that I have to find which application is making this call.
    I tried with enabling JDBC logging and than grep for "DriverManager.getConnection" in each domain but this way I can only detrmine that an application of a particular domain is making direct JDBC connection. But I am still not able to find which application is making this call?
    Did any body try this?
    any suggestion?
    Thanks,
    Qumar

    Qumar Hussain wrote:
    Hi All,
    I have 15 domains each having 100 or more applications[.ear,.jar,.war] on a single Solaris box[Dev Env].
    One of these applications[out of 100*15] of one domain[out 15] is making direct JDBC connection.[DriverManager.getConnection(URL,p)]. Now the issue is that I have to find which application is making this call.
    I tried with enabling JDBC logging and than grep for "DriverManager.getConnection" in each domain but this way I can only detrmine that an application of a particular domain is making direct JDBC connection. But I am still not able to find which application is making this call?
    Did any body try this?
    any suggestion?
    Thanks,
    QumarOne very direct way to do this is to get the source for DriverManager,
    and edit it to throw an exception from getConnection(), and compile the
    source, and put the class file in the bootclasspath (not the regular
    classpath) of the JVM via a commandline option when you boot WebLogic.
    Eg: if the hacked DriverManager class is in /mytempdir/java/sql/DriverManager.class
    cd /mytempdir
    jar cvf hack.jar java/sql/*.class
    edit the start-weblogic script to start weblogic with a commandline
    argument:
    java -Xbootclasspath/p:/mytempdir/hack.jar ....

  • SQLException while calling a Stored Procedure in Oracle

    Hi all,
    I am getting this error while calling a Stored Procedure in Oracle...
    java.sql.SQLException: ORA-00600: internal error code, arguments: [12259], [], [
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:207)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:540)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1273)
    at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:780)
    at oracle.jdbc.driver.OracleResultSet.next(OracleResultSet.java:135)
    at StoredProcedureDemo.main(StoredProcedureDemo.java:36)
    The Program is ...
    import java.sql.*;
    public class StoredProcedureDemo {
         public static void main(String[] args) throws Exception {
              Connection con = null;
              ResultSet rs = null;
              Statement st = null;
              CallableStatement cs = null;
              int i;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   con = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:SHYAM","scott","tiger");
                   System.out.println("Got Connection ");
                   st = con.createStatement();
                   String createProcedure = "create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS"
                             +" Emp_name VARCHAR2(10);"
                             +" CURSOR c1 (Depno NUMBER) IS"
                             +" SELECT Ename FROM emp WHERE deptno = Depno;"
                             +" BEGIN"
                             +" OPEN c1(Dept_num);"
                             +" LOOP"
                             +" FETCH c1 INTO Emp_name;"
                             +" EXIT WHEN C1%NOTFOUND;"
                             +" END LOOP;"
                             +" CLOSE c1;"
                             +" END;";
                   System.out.println("Stored Procedure is \n"+createProcedure);
                   i = st.executeUpdate(createProcedure);
                   System.out.println("After creating the Stored Procedure "+i);
                   cs = con.prepareCall("{call Get_emp_names(?)}");
                   System.out.println("After calling the Stored Procedure ");
                   cs.setInt(1,20);
                   System.out.println("Before executing the Stored Procedure ");
                   rs = cs.executeQuery();
                   System.out.println("The Enames of the given Dept are ....");
                   while(rs.next()) {
                        System.out.println("In The while loop ");
                        System.out.println(rs.getString(1));
              catch (Exception e) {
                   e.printStackTrace();
    Stored Procedure is ...
    create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS
    Emp_name VARCHAR2(10);
    CURSOR c1 (Depno NUMBER) IS
    SELECT Ename FROM emp WHERE deptno = Depno;
    BEGIN
    OPEN c1(Dept_num);
    LOOP
    FETCH c1 INTO Emp_name;
    EXIT WHEN C1%NOTFOUND;
    END LOOP;
    CLOSE c1;
    END;
    Stored procedure is working properly on sql*plus(Oracle 8.1.5)) editor. But it is not working from a standalone java application. Can anyone please give me a solution.
    thanks and regards
    Shyam Krishna

    The first solution is to not do that in java in the first place.
    DDL should be in script files which are applied to oracle outside of java.
    Other than I believe there are some existing stored procedures in Oracle that take DDL strings and process them. Your user has to have permission of course. You can track them down via the documentation.

  • SQLException: Cursor is closed while calling a java stored procedure

    Hi,
    I got the following error when trying to read from a cursor of a java stored procedure:
    java.sql.SQLException: Cursor is closed
    The java procedure is stored in the database and wrapped by a sql call. Then another java class executes the sql call.
    The stored procedure looks like this:
    import java.io.Reader; import java.security.MessageDigest; import java.sql.*; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import oracle.jdbc.OracleCallableStatement; import oracle.jdbc.OracleConnection; public class test { static Connection conn = null; static String username = null; static String password = null; static Integer userid  = null; public static void main(String args[]) throws Exception {     username = "keller";     password = "945435";     login(username, password); }       public static String login(String in_username, String in_password) {     String access = null;     String password = null;         try {             DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());  // Non OracleVM             System.out.print("Verbindung wird initialisiert... ");             conn =         //DriverManager.getConnection("jdbc:default:connection:");           //conn.setAutoCommit(false);             DriverManager.getConnection("jdbc:oracle:thin:@[...]:1521:[...]","[...]","[...]");             System.out.println("OK");                         System.out.print("Logindaten werden ueberprueft... ");             String sql = "SELECT matrikelnr, password FROM student WHERE name = ?";             PreparedStatement pstmt = conn.prepareStatement(sql);             pstmt.setString(1, in_username);             ResultSet rset = pstmt.executeQuery();             while (rset.next())             {             userid = rset.getInt(1);                 password = rset.getString(2);             }             access = "student";                         pstmt = conn.prepareStatement(sql);             if (password == null) {             sql = "SELECT dozentnr, password FROM dozent WHERE name = ?";                 pstmt = conn.prepareStatement(sql);                 pstmt.setString(1, in_username);                 rset = pstmt.executeQuery();                 while (rset.next())                 {             userid = rset.getInt(1);                     password = rset.getString(2);                                     }                 pstmt = conn.prepareStatement(sql);                 if (password == null) {                   throw new SQLException("User nicht gefunden!");                 }                 access = "dozent";             }             //rset.close(); // Resultset schließen             //pstmt.close(); // Statement schließen                         // MD5 Hash vergleichen             MessageDigest md5 = MessageDigest.getInstance("MD5");             md5.reset();             md5.update(in_password.getBytes());             byte[] result = md5.digest();             StringBuffer hexString = new StringBuffer();             for (int i=0; i<result.length; i++) {               if(result[i] <= 15 && result[i] >= 0){                 hexString.append("0");               }               hexString.append(Integer.toHexString(0xFF & result));
    if (password != null) {
    if (password.equals(hexString.toString())) {
    System.out.println("OK");
    } else {
    throw new Exception("Falsches Passwort!");
    catch(SQLException e) {
    System.err.println("SQL Fehler!");
    System.err.println(e.getMessage());
    catch(Exception e) {
    System.err.println("Fehler!");
    System.err.println(e.getMessage());
    return access;
    public static void getLeistungsschein(int matrikelnr, ResultSet[] rout)
    ResultSet rs = null;
    try
    System.out.print("Berechtigung ueberpruefen... ");
    if (userid != matrikelnr)
    throw new Exception("Zugriff verweigert, keine Berechtigung!");
    int mnr = matrikelnr;
    ((OracleConnection)conn).setCreateStatementAsRefCursor(true);
    PreparedStatement ps = conn.prepareStatement("select bezeichnung, note from klausur inner join leistungsschein on klausur.KLAUSURNR=leistungsschein.KLAUSURNR where matrikelnr= ?");
    ps.setInt(1, mnr);
    rs = (ResultSet)ps.executeQuery();
    rout[0]= rs;
    catch(SQLException e) {
    System.err.println("Fehler!");
    System.err.println(e.getMessage());
    catch(Exception e) {
    System.err.println("Fehler!");
    System.err.println(e.getMessage());
    The sql call:
    create or replace
    procedure pgetleistungsschein(matrikelnr in number, cur OUT refcurpkg.refcur_t) is
    language java name 'Klausurverwaltung.getLeistungsschein(int, java.sql.ResultSet[])';
    And finally the wrapper is called by another java programm, see this:
    import java.sql.*;
    import java.util.ArrayList;
    import java.util.List;
    import oracle.jdbc.OracleCallableStatement;
    import oracle.jdbc.OracleResultSet;
    import oracle.jdbc.OracleTypes;
    public class cursortest {
    public static void main(String[] args) {
    try{
    //-- Oracle Treiber laden
    Class.forName( "oracle.jdbc.driver.OracleDriver" );
    Connection c = DriverManager.getConnection( "jdbc:oracle:thin:@sligo.fh-trier.de:1521:ubuntu", "dbsem_java","javajava");
    CallableStatement stmt = null;
    ResultSet rs1 = null;
    int matrnr = 945098;
    // Call PLSQL Stored Procedure
    stmt = (CallableStatement)c.prepareCall("{ call ? := getklausuren(?) }");
    stmt.setInt(2, matrnr);
    // 2nd parameter is OUT paremeter
    stmt.registerOutParameter(1, OracleTypes.CURSOR);
    // Execute the callable statement
    stmt.execute();
    //Cursor in ResultSet einlesen
    rs1 = ((OracleCallableStatement)stmt).getCursor(1);
    ResultSetMetaData rsmd = rs1.getMetaData();
    int anzSpalten = rsmd.getColumnCount();
    List<String[]> zeilen = new ArrayList<String[]>();
    while(rs1.next())
    String[] zeile = new String[anzSpalten];
    for (int i=1; i<=anzSpalten; i++)
    zeile[i-1]=rs1.getString(i);
    zeilen.add(zeile);
    String[][] array_angeb_klaus = (String[][])zeilen.toArray(new String[zeilen.size()][anzSpalten]);
    //**** ENDE
    rs1.close();
    stmt.close();
    //c.close();
    catch (SQLException e){
    System.out.println(e);
    catch (ClassNotFoundException f){
    System.out.println(f);

    On top of what jschell says, this just looks wrong in terms of how Oracle's internal Java works as well.
    [Have a look here |http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/refcur/index.html] (unless things have changed significantly over the past few years for Oracle Java).
    Is the db you are querying a different one to the one this Java is stored in?

  • Unable to connect to Coudscape using DriverManager.getConnection(...)

    Hi All,
    I am trying to connect to a Cloudscape database.
    While the driver class - "com.ibm.db2j.jdbc.DB2jXADataSource" is getting loaded, DriverManager.getConnection(url) gives the follwoing exception:
    java.sql.SQLException: No suitable driver
    java.sql.DriverManager.getConnection(DriverManager.java:559)
    java.sql.DriverManager.getConnection(DriverManager.java:211)
    Can someone please tell me what could be the reason of my getting this error inspite of the driver class being loaded?
    Thank you.
    Regards,
    Sunil.

    Either the driver has not been loaded, or the connect string is wrong. Put debugging output immediately before and after the Class.forName() call to make sure it is executed succesfully. Then check the connect string.

  • Error while calling a Db2 stored proc  using Dataservice

    Hi ,
    I am getting the following exception while calling a Db2 proc.The proc is not returning any refcursor.It has one Input param of type String.We are expecting the result in resultset. I am able to call the proc using JDBC function and iterate tru the resultset and print it.
    While doing import the source Metadata , I Added a "Editable Row Set" Type.
    Any clue ?
    ava.lang.RuntimeException: Incorrect definition, too many return resultset
         at com.bea.ld.wrappers.procedure.ProcedureAdapter$CallableWrapper.getNextReturnValue(ProcedureAdapter.java:634)
         at com.bea.ld.wrappers.procedure.ProcedureIterator.getNextToken(ProcedureIterator.java:249)
         at com.bea.ld.wrappers.procedure.ProcedureIterator.fetchNext(ProcedureIterator.java:125)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:134)
         at weblogic.xml.query.runtime.sequences.Subsequence.fetchNext(Subsequence.java:106)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.runtime.querycide.QueryAssassin.fetchNext(QueryAssassin.java:54)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
         at weblogic.xml.query.runtime.qname.InsertNamespaces.fetchNext(InsertNamespaces.java:161)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.runtime.core.QueryIterator.fetchNext(QueryIterator.java:127)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:134)
         at weblogic.xml.query.xdbc.util.Serializer.serializeItems(Serializer.java:142)
         at com.bea.ld.server.QueryInvocation.getResult(QueryInvocation.java:461)
         at com.bea.ld.EJBRequestHandler.executeFunction(EJBRequestHandler.java:346)
         at com.bea.ld.ServerBean.executeFunction(ServerBean.java:108)
         at com.bea.ld.Server_ydm4ie_EOImpl.executeFunction(Server_ydm4ie_EOImpl.java:208)
         at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:491)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:120)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

    Hi,
    I am trying to do something like this but with Oracle stored procedure which returns an associate array and a cursor and these are defined as INOUT. I am not finding a way how to do it with editable row set. Can you plese list the steps used to make things work.
    Thanks.

  • Error while calling "BAPI_CUSTOMER_FIND" in BPM

    Hi everyone,
    we have a problem while calling a BAPI "BAPI_CUSTOMER_FIND" on an ECC backend system from a BPM. This automatic activity works very well if we just search some customers, which really exist in the ECC system. If we search any customers, which don't exist, we get a runtime exception on the CE server. But what really wired is, we can call this BAPI in the WS Navi on the CE successfully with any input parameters. This BAPI gives back a result_tab in the response message. In the result_tab, we can find the TYPE field indicating whether any customers are found or not. Actually this BAPI will not generate any exceptions. In order to exclude mapping errors, we delete the output mapping for this step. Could anyone give us some help? Thanks a lot in advance.
    The error trace is following:
    An error occurred while executing transition AUTOMATED_ACTIVITY_Debitor_suchen
    com.sap.glx.adapter.BPMNAdapter:Token_0_ShowCase_Handwerkerparkausweis_0f40fca3e9c74b4385726b3cd6a3245d token,
    com.sap.glx.adapter.BPMNAdapter:Instance_0_ShowCase_Handwerkerparkausweis_0f40fca3e9c74b4385726b3cd6a3245d parent,
    com.sap.glx.adapter.internal.ContainerAdapter:Context_2_Antrag_Kontext_0f40fca3e9c74b4385726b3cd6a3245d context_3){
    exit=new com.sap.glx.adapter.BPMNAdapter:Exit();
    Caused by: com.sap.glx.adapter.api.AdapterException: RuntimeException occured with not AbapException
    at com.sap.glx.adapter.app.ucon.SCADASWrapperImpl.invoke(SCADASWrapperImpl.java:162)
    at com.sap.glx.adapter.app.ucon.UnifiedWebServiceCallObject.invokeWebServiceOperation(UnifiedWebServiceCallObject.java:100)
    at com.sap.glx.adapter.app.ucon.UnifiedWebServiceCallClass.invoke(UnifiedWebServiceCallClass.java:174)
    at com.sap.glx.core.dock.impl.DockObjectImpl.invokeMethod(DockObjectImpl.java:530)
    ... 14 more
    Caused by: java.lang.RuntimeException: Es sind Warnungen aufgetreten
    at com.sap.sdo.das.jco.JCoInvoker.checkReturnStructure(JCoInvoker.java:350)
    at com.sap.sdo.das.jco.JCoInvoker.accept(JCoInvoker.java:257)
    at com.sap.engine.services.sca.plugins.jco.JCoImplementationInstance.accept(JCoImplementationInstance.java:56)
    at com.sap.engine.services.sca.das.SCADASImpl.invokeReference(SCADASImpl.java:335)
    at com.sap.glx.adapter.app.ucon.SCADASWrapperImpl.invoke(SCADASWrapperImpl.java:116)
    regards
    Xiang
    Edited by: Xiang Zhang on Jun 14, 2010 2:48 PM
    Edited by: Xiang Zhang on Jun 14, 2010 2:57 PM

    Hi Xiang,
    You may need to check if the JCo settings are fine and connectivity is proper.
    Regards,
    Arafat

  • Java.rmi.RemoteException: EJB Exception: while calling an EJB method,

    Hi
    I am getting below error while calling a stateless EJB method. There is some validation checks while performing ejb's modify() method and a RuntimeException is thrown in case of validation failure.The modify() method internally calls other stateless ejb as well.
    The problem I'm facing is, instead of getting the expected RuntimeException in the Servlet, i am getting RemoteException. I am using WLS 9 MP1, all participating ejbs are stateless and i am using default transaction attributes(Supports) for these ejbs.
    The interesting part is, at the ejb layer RuntimeException is thrown as expected, but this exception changed to RemoteException at the servlet's end where i am catching the ejb call exceptions.
    I am new to WLS, please suggest/help me out of this exception.
    Any help is truly appreciated.
    java.rmi.RemoteException: EJB Exception: ; nested exception is: java.lang.RuntimeException:
         at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:95)
         at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:713)
         at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:681)
         at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:447)
         at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
         at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
         at com.mycomp.base.BaseController_8x2e52_EOImpl.modify(BaseController_8x2e52_EOImpl.java:149)
         at com.mycomp.webgui.servlet.FrontComponent.service(FrontComponent.java:207)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Thanks!
    Edited by: user10721298 on Feb 23, 2009 4:16 AM

    Hi,
    If i don't misunderstand, you are using the RuntimeException as an application exception, right?
    Have you annotated it or denoted it in deployment descriptor?
    Thanks,
    Amy

  • AbstractMethodError while calling PreparedStatement.setBinaryStream()

    I am getting AbstractMethodError while calling PreparedStatement.setBinaryStream(int, InputStream) for a BLOB column
    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
    JDBC Driver ojdbc6.jar (downloaded from oracle website corresponding to 11.2.0.2 version)
    JDK 6
    I understand this error is due to my code calling abstract method which is not available in JDBC 3.x and it requires JDBC 4.0
    But I am not able to find any traces of usage of earlier version of driver.
    Debugging steps performed with results are as below
    1) I enabled -verbose:class VM argument that outputs all the classes loaded along with jar from which it loads. Everywhere i see ojdbc6.jar (No reference to older or any other jdbc driver jar file)
    2) Below is code segment and its output
    Connection con = getConnection(); // get connection
    DatabaseMetaData d= con.getMetaData();
    d.getDatabaseProductName(); // output: Oracle
    d.getDatabaseProductVersion(); // output: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    d.getDatabaseMajorVersion(); // output: 11
    d.getDatabaseMinorVersion(); // output: 2
    d.getDriverName(); // output: Oracle JDBC driver
    d.getDriverVersion(); // output: 11.2.0.2.0
    d.getDriverMajorVersion(); // output: 11
    d.getDriverMinorVersion(); // output: 2
    d.supportsGetGeneratedKeys(); // output: true
    3) I updated code (its third party component, so not suppose to update :( )
    Added third argument whick works fine (it means at runtime it is using older jdbc driver???)
    PreparedStatement.setBinaryStream(int, InputStream, (int)length
    Please let me know if i am missing anything here... how can i solve this issue?
    Thanks!

    From my initial post
    I am getting AbstractMethodError while calling PreparedStatement.setBinaryStream(int, InputStream) for a BLOB column
    3) I updated code (its third party component, so not suppose to update )
    Added third argument whick works fine (it means at runtime it is using older jdbc driver???)(3) will not work if correct ojdbc6.jar is used. Because third argument is int and not long. long will work with ojdbc6 but will not work with older version.
    I am using third party component and they are using - PreparedStatement.setBinaryStream(int, InputStream)
    It should work with JDK 6, Oracle 11g and ojdbc6.jar driver.
    I am sure its simple classpath issue or some configuration mismatch - just couldn't see it right now.
    I will probably create new workspace / or test on other system now
    Thanks!

  • Problems with setting DriverManager.getConnection as a variable

    HI,
    I was wondering if someone could help me out with a problem i have. I am trying to read in the url, user name and password from an external file, and then add it to con = DriverManager.getConnection(IN HERE);
    I know that i can connect to the database and retrieve information by entering the connection in the following format: ("jdbc:mysql://url:3306/database","userName","password"). But i want to be able to read this line from an external file. When trying to do so i keep getting back the following error in the console window:
    Exception in thread "main" java.sql.SQLException: No suitable driver found for "jdbc:mysql://url:3306/database","userName","password"
    at java.sql.DriverManager.getConnection(DriverManager.java:602)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    at fast.JDBC.openDB(JDBC.java:68)
    at fast.JDBC.main(JDBC.java:40)
    Any help with this would be appreciated!
    I am using the following code:
    public class JDBC { private Connection con; public static String filePath = "C:\\Users\\Documents\\Connector.txt"; public static String sql = ("SELECT * FROM users"); public String readFileAsString(String filePath) throws IOException { //Read connector from a file byte[] connectionDB = new byte[(int) new File(filePath).length()]; BufferedInputStream f = new BufferedInputStream(new FileInputStream(filePath)); f.read(connectionDB); return new String (connectionDB); }//Close readFileAsString public static void main (String[] Args) throws Exception { JDBC j = new JDBC(); j.openDB(); j.readDB(sql); //System.out.println(j.readFileAsString(filePath)); } /** * Process for creating a connection to a database * @return * @throws Exception */ public boolean openDB() throws Exception { boolean connected = false; JDBC j = new JDBC(); String connectionDB = j.readFileAsString(filePath); System.out.println(connectionDB); //Load Drive Class.forName("com.mysql.jdbc.Driver"); //Establish connection to database try { con = DriverManager.getConnection(connectionDB); } finally { connected = true; } return connected; }//close openDB

    This is what I did for my OracleDb which required that I download a driver from the Oracle Site. You install the driver and then link the driver through the DriverManager object. It looks like your using a local JDB database - which I have never had to make use of. Here is my code for the OraceXE database. Hope this helps.
    Public Class GenericCnn Object
    private String _urlDbCnn       = "";   // the JDBC url to the database
    private String _username       = "";   // a valid username to access the database
    private String _password       = "";   // a valid password to access the database
    private String _dbDriver       = "";   // a valid JDBC driver
    private Connection _cnn            = null; // this will be the active connection
    private String _sqlStatement   = null; // this will be the statement to execute against the database
    public DbConnection(){
    this("oracle.jdbc.OracleDriver",
    "jdbc:oracle:thin:@//192.168.15.200:1521/xe",
    "usernamehere,
    "passwordhere");
    } // constructor - nothing
    public DbConnection(String nwDbDriver, String nwDbURL,
    String nwDbUsername, String nwDbPassword){
    this.setDbDriver(nwDbDriver);
    this.setUrlDbCnn(nwDbURL);
    this.setUsername(nwDbUsername);
    this.setPassword(nwDbPassword);
    } // constructor - DbDriver, DbUrl, DbUser, DbPassword
    private void initializeConnection(){
    // try - get database driver
    try{
    DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
    // try - initialize the database connection
    try{
    this._cnn = DriverManager.getConnection(this._urlDbCnn,
    this._username,
    this._password);
    }catch(SQLException e){
    ErrorTrap trap = new ErrorTrap(ErrorTrapMessage.DataConnectionNotIntitialized, e);
    } // catch - try and initialize the database connection
    }catch(SQLException e){
    ErrorTrap trap = new ErrorTrap(ErrorTrapMessage.DataConnectionDriverFailedToLoad, e);
    } // catch - try and get database driver
    } // method - OpenConnection
    .. executeTransaction -> calls initializeConnection
    .. executeQuery - > calls initialzieConnection
    .. properties
    Edited by: Monkey247 on Jan 26, 2010 10:27 AM

  • Teradata connection error in jdbc -- DriverManager.getConnection()

    I have issue while connecting to teradata DB from a sampel jave jdbc code.
    the code is as below.
    String url="jdbc:teradata://10.33.22.27/AMRROCD";
    Class.forName("com.teradata.jdbc.TeraDriver");
    Properties x = new Properties();
    x.put("user","user123");
    x.put("password","pwd123");
    Connection con = DriverManager.getConnection (url, x);--> i am getting error at this line as
    GSSException: Failure unspecified at GSS-API level (Mechanism level: UserFile parameter null)
    at com.teradata.tdgss.jtdgss.TdgssParseXml.<init>(DashoA1*..)
    at com.teradata.tdgss.jtdgss.TdgssConfigApi.<init>(DashoA1*..)
    at com.teradata.tdgss.jtdgss.TdgssManager.<init>(DashoA1*..)
    at com.teradata.tdgss.jtdgss.TdgssManager.getInstance(DashoA1*..)
    at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:583)
    at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(GenericTeraEncrypt.java:601)
    at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameForOid(GenericTeraEncrypt.java:694)
    at com.teradata.jdbc.AuthMechanism.<init>(AuthMechanism.java:50)
    at com.teradata.jdbc.jdbc.GenericInitDBConfigState.action(GenericInitDBConfigState.java:105)
    at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:49)
    at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:195)
    at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.<init>(TeraLocalConnection.java:94)
    at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:55)
    at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:216)
    at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:149)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at dbValidation.main(dbValidation.java:25)
    Error java.lang.NullPointerException
    could anybody have an idea on this , its urgent for me to solve this.
    I am able to execute the code in windows OS . this error is occourring in UNIX system

    You'd have to pursue Teradata for support/help with their JDBC driver. This has nothing
    to do with Oracle though...

  • Stopped threads waiting on DriverManager.getConnection()?

    Solaris 5.8, Sun JDK 1.3.1-b24
    RMI based application with the server piece running as a Java app on Solaris. After a few hours of use, with 100-150 users, the server app appears to hang from the client. If I do a kill -3 on the server process, I see a whole buttload of threads (over 100) stuck on DriverManager.getConnection() method (see below). The trace doesn't show anything deeper than that, but it is Oracle thin client being used. Our DBAs don't see any connections being attempted in the listeners log, and in fact, the number of the connections I see to the DB box via netstat jives exactly with the number of sessions I see on the Oracle side (in V$SESSION). While this is going on, I can connect to the DB box from the app server box all day long using a small class I wrote that just does a connection open and close.
    This app was working fairly flawlessly until about a week ago. Nothing in terms of drivers or JVM version has changed, but there has been slightly more user load lately. It seems that every new user request that comes in after a certain point ends up with a thread blocked like this. What is the thread stopped in getConnection() indicative of? Has anyone seen anything like this?
    Much appreciated,
    Mike
    Tons of these show in the thread dump (kill -3):
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:"RMI TCP Connection(11307)-10.160.96.220" daemon prio=5 tid=0x4946d0 nid=0x2e7b waiting for monitor entry [0xd4480000..0xd44819e0]
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:     at java.sql.DriverManager.getConnection(DriverManager.java:193)
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:     at sched_MT.rmiSched_MTImpl.getLocation(rmiSched_MTImpl.java:556)
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:     at java.lang.reflect.Method.invoke(Native Method)
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:     at sun.rmi.transport.Transport$1.run(Transport.java:152)
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:     at java.security.AccessController.doPrivileged(Native Method)
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:     at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
    Wed May 19 11:40:04 EDT 2004:ExecGroup-0:out:     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)

    Yes - it is roughly 1 user : 1 DB connection. No pooling. Rogue app that we inherited. Ack. While it's blocking users, I can connect to the DBs fine (there are 2) from another app on the same box using the same DB logins and the same DBs, so my impression is that it's not DB related, but at this point, I am not completely sure about that. Our DBA says TNS is not getting any connect attempts during this time, so it seems like the driver is not even attempting.

  • JDBC: java.lang.ExceptionInInitializerError on DriverManager.getConnection

    I've been developing an app on Linux and had the JDBC connector working fine, connecting to mySQL.
    Now when I try to run it on Solaris 2.8 with Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05), I get the following error trying a connect...
    Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.mysql.jdbc.Connection.<init>(Connection.java:1175)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:193)
    at ps.DataCollector.getData(DataCollector.java:46)
    at ps.PacketSchedular.main(PacketSchedular.java:30)
    Caused by: java.lang.RuntimeException: Unable to initialize character set mapping tables
    at com.mysql.jdbc.CharsetMapping.<clinit>(CharsetMapping.java:73)
    ... 6 more
    my java file is ....
    public class DataCollector {
    private String database = "oui";
    private String user = "user";
    private String passwd = "password";
    private int portNum = 3306;
    public DataCollector () {
    public void getData() {
    Statement stmt = null;
    Connection conn = null;
    ResultSet rs = null;
    try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/" + database + "?port=" + portNum + "&user=" + user + "&password=" + passwd + "&autoReconnect=false");
    etc
    etc
    I'm using the mysql connector 'mysql-connector-java-3.1.8-bin.jar' and i've also downgraded to an earlier release which had no positive effect.
    Google (unusually) has given me no hints!
    Any suggestions as to what may be causing this?
    Thanks

    I can connect to the server locally and also telnet to port 3306 and get a response!
    telnet localhost 3306Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    4
    5.0.18LIVU'`/hA,I*7tf~jx>iu2
    I use this same server with Perl every day (although Perl is using a socket to connect).
    I've searched pretty much everywhere for a fix - but to no avail.
    Thanks

Maybe you are looking for

  • Connecting to Oracle9i through ADO

    Hi, I have an visual basic 6.0 application .It connects to the Database using ADO .The application works fine with Oracle7.x and Oracle 8i.However there are issues when the Database is Oracle 9i.The problem is Stored Procedures using ADO do not get e

  • Can't installed Itunes on Windows

    Hi, Can anyone help me on this error msg. thanks

  • Samples fall under a different category than production systems

    hi in http://www.oracle.com/technetwork/developer-tools/adf/learnmore/november2011-otn-harvest-1389769.pdf section "How to detect browser type and version from ADF Faces" (p. 22) Frank Nimphius writes "Ps.: I can almost hear John Stegeman, the Oracle

  • Printing Color Problems mac pro to epson r2400

    I have a Mac Pro upgraded from a G5 and I am having difficulty printing the colors properly to my Epson r2400. I downloaded the newest driver from epson 6.57 but it is no different and still have colors printing wrong. Looks good onscreen but nothing

  • Approve Requisitions Fiori application issue

    Hi, We have configured a standard "Approve Requisitions" application on the Fiori launchapad. The application workflow is working fine from Portal end for first two scenarios, but the workflow status doesn't get changed in R/3 for Scenario3 and 4 as