What's wrong with COM.ibm.db2.jdbc.app.DB2Driver?

Hello everybody,
first of all I posted this on
http://www-105.ibm.com/developerworks/java_df.nsf/AllViewTemplate?OpenForm&RestrictToCategory=33
so you can check the IBM forum as well, may be some IBM gurus can comment this...
I'm using the COM.ibm.db2.jdbc.app.Driver shipped with DB2Connect v6.1, v7.1 (tested both on NT and SunOS 5.6, 5.8), the database is DB2 v6, v7 running on an OS390. I am pretty confused:DatabaseMetaData.getProcedureColumns(catalog, schemaPattern, namePattern)cannot handle the namePattern parameter correct. It works only with "", null and "%". Passing any other value results in :COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0206N  "PROCEDURE " ist in dem verwendeten Kontext ung�ltig.  SQLSTATE=42703
     at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:241)
     at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:186)
     at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:419)
     at COM.ibm.db2.jdbc.app.DB2DatabaseMetaData.getProcedures(DB2DatabaseMetaData.java:1446)I think that even if the pattern doesn't match any procedure the function should return an empty ResultSet. The only "solution" is to scroll all the procedures in the ResultSet until you find the passing ones. Does IBM think this is serious?
I have dug a bit and found another incompatibitly with the JDBC specification: the names of the result set columns returned by DatabaseMetaData.getProcedureColumns() as returned by the DB2Driver:
PROCEDURE_CAT
PROCEDURE_SCHEM
PROCEDURE_NAME
COLUMN_NAME
COLUMN_TYPE
DATA_TYPE
TYPE_NAME
COLUMN_SIZE
BUFFER_LENGTH
DECIMAL_DIGITS
NUM_PREC_RADIX
NULLABLE
REMARKS
Here comes the JDBC specification:
<quote>
Each procedure description has the the following columns:
PROCEDURE_CAT String => procedure catalog (may be null)
PROCEDURE_SCHEM String => procedure schema (may be null)
PROCEDURE_NAME String => procedure name
COLUMN_NAME String => column/parameter name
COLUMN_TYPE Short => kind of column/parameter:
procedureColumnUnknown - nobody knows
procedureColumnIn - IN parameter
procedureColumnInOut - INOUT parameter
procedureColumnOut - OUT parameter
procedureColumnReturn - procedure return value
procedureColumnResult - result column in ResultSet
DATA_TYPE short => SQL type from java.sql.Types
TYPE_NAME String => SQL type name, for a UDT type the type name is fully qualified
PRECISION int => precision
LENGTH int => length in bytes of data
SCALE short => scale
RADIX short => radix
NULLABLE short => can it contain NULL.
procedureNoNulls - does not allow NULL values
procedureNullable - allows NULL values
procedureNullableUnknown - nullability unknown
REMARKS String => comment describing parameter/column </quote>
I would appreciate your comments.
Regards,
Anton Maleev
IT Consultant, Software Engineer
Frankfurt, Germany
mailto: [email protected]

Futhermore, when you call DatabaseMetaData.getProcedures(catalog, schemaPattern, "%") when you specified schemaPattern it returns all the procedures no mather if the schema matches the pattern...

Similar Messages

  • Class not found error for COM.ibm.db2.jdbc.app.DB2Driver

    i have written this code:
    import java.io.*;
    import java.sql.*;
    public class tryjdbc
    {  public static void main (String args[])
    {  try
    {  Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");  }
    catch (java.lang.ClassNotFoundException e)
    {  System.out.print(e.getMessage());  }
    and once i try to run it, it gives out a class not found exception error.
    I haven't changed anything with the classpath since I don't think the problem is with the classpath. I have read in the IBM Developer Kit for Java documentaton that the AS/400 Developer Kit for Java automatically adds the db2_class.jar file to the classpath. So why do I get a class not found exception error?

    I was using Web Spehere 4.0.3 and trying to connect to a database on DB2 7.2. I was just following a tutorial and trying to get a handle on Web Sphere. I am running all of these on a Windows 2000 Operating System. Here are some of my observations :
    a. db2java.zip packaged under %DB2ROOT%\SQLLIB\JAVA, does not work.
    b. CLASSPATH needs to be set to %DB2ROOT%\sqllib\java12\db2java.zip
    c. Include this as one of the packages in the package defined in
    WebSphere, using the Java Perspective.
    d. Ensure that case sensitivity is respected. All though the package
    shows up as COM.ibm.db2.jdbc.app.DB2Driver, for some reason, it
    will only accept com.ibm.db2.jdbc.app.DB2Driver.
    With these settings, I was able to connect to a db2 database.
    I am a little puzzled on the following. I did not include java.io package, but still it could print the messages. Did anybody have a similar experience
    Thanks for this posting.

  • No Suitable Driver Exception and COM.ibm.db2.jdbc.app.DB2Driver

    Greetings,
    I am attempting to connect to a DB2 UDB (6.1) on an AIX (4.x) box from a win95 box and have cobbled some code together to do this. Despite loading and verifying that the driver loads, I get nothing but the SQLException: "No Suitable Driver". My Java code follows for comment. Thanks in advance...
    import java.lang.reflect.*;
    import java.sql.*;
    import java.io.*;
    class db2JDBCtest
    static Driver driver = null;
    static final String url = "jdbc:db2//1xx.x.x4x.xx/";
    public static void main(String args[]) {
    Connection con = null;
    // GET CONNECTION
    try
    driver = (Driver)Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
    System.out.println(driver);
    if (args.length == 3) {
    con = DriverManager.getConnection(url + args[0], args[1], args[2]);
    else{
    System.out.println("\nUsage: java db2JDBCtest [databasealias username password]\n");
    System.exit( - 1 );}
    // GET CONNECTION WARNINGS
    SQLWarning warning = null; {   
    warning = con.getWarnings();
    if (warning == null){
    System.out.println("No Warnings");
    return; }
    while (warning != null) {
    System.out.println("Warning: "+warning);
    warning = warning.getNextWarning();
    // CREATE PREPARED STATEMENT
    PreparedStatement prepstmt;
    prepstmt = con.prepareStatement("select * from MDM.DEALER where 1=0");
    // GET RESULTS !
    ResultSet resultset = prepstmt.executeQuery();
    System.out.println(resultset);
    prepstmt.close();
    catch
    (Exception e){
    System.out.println(e);
    }

    1)IBM document says that you use COM.ibm.jdbc.net.DB2Driver when you use Applets
    2)For applications use COM.ibm.jdbc.app.DB2Driver
    3)Both these files are in db2java.zip file
    4)db2java.zip is the DB2 driver just like classes111.zip is the driver for Oracle
    6)You need to put db2java.zip in your classpath.
    5)If you are using COM.ibm.jdbc.net.DB2Driver and you are getting "COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0616E Error opening socket
    . SQLSTATE=08S01 "
    you need to run "db2jstrt" on the target host(machine running DB2) with the specified port as the parameter
    6)If you are using COM.ibm.jdbc.app.DB2Driver and getting " java.sql.SQLException: No suitable driver ", most probably db2java.zip is not in classpath.
    7)Note : you need to install DB2 client software on the application machine, just putting the zip file does not work.
    8)There is a Java file at IBM that walks you thru the connection.
    ftp://ftp.software.ibm.com/software/websphere/info/tools/jdbctest
    Just download in into the client machine, compile and run it.

  • Cannot load driver COM.ibm.db2.jdbc.app.DB2Driver

    Hi ,
    I need help on this matter and will really appreciate.
    I have installed Jdeveloper 11g and Weblogic 11gR1 on windows. I am trying to configure my weblogic server for JDBC-Datasourse to connect to DB2 and get this error.
    cannot load driver COM.ibm.db2.jdbc.app.DB2Driver
    This is how my classpath and path looks
    classpath :.;C:\Program Files\JDEdwards\BPMBroker\JRE\1.3\lib\ext\QTJava.zip;C:\Program Files\Java\jdk1.6.0_20\lib\tools.jar;C:\Program Files\Java\jdk1.6.0_20\lib\dt.jar;C:\Program Files\Java\jre6\lib\rt.jar;C:\Sun\db2java.zip;C:\Sun\COM\ibm\db2\jdbc\app\DB2Driver.class;C:\Program Files\IBM\WebSphere\AppServer\derby\lib\deprecated\db2jcc.jar;C:\Program Files\IBM\WebSphere\AppServer\derby\lib\deprecated\db2jcc_license_cu.jar;
    path : C:\Program Files\Java\jdk1.6.0_20\bin;C:\Sun\db2java.zip;
    I don't know what to do and everytime i try to test my connection i get this error .
    Please help.
    Thank you

    I added Driver Classname =com.ibm.db2.jcc.DB2Driver
    and now it no longer gives me cannot load driver COM.ibm.db2.jdbc.app.DB2Driver.
    But now i am getting
    Execution failed due to a distribution protocol error that caused deallocation of the conversation. A DRDA Data Stream Syntax Error was detected. Reason: 0x1 DB2ConnectionCorrelator: null
    com.ibm.db2.jcc.b.cb.l(cb.java:1207)
    com.ibm.db2.jcc.b.cb.c(cb.java:357)
    com.ibm.db2.jcc.b.cb.v(cb.java:1440)
    com.ibm.db2.jcc.b.db.a(db.java:42)
    com.ibm.db2.jcc.b.b.e(b.java:1165)
    com.ibm.db2.jcc.b.b.b(b.java:1090)
    com.ibm.db2.jcc.b.b.q(b.java:925)
    com.ibm.db2.jcc.b.b.a(b.java:665)
    com.ibm.db2.jcc.b.b.a(b.java:654)
    com.ibm.db2.jcc.b.b.<init>(b.java:293)
    com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:165)
    com.bea.console.utils.jdbc.JDBCUtils.testConnection(JDBCUtils.java:505)
    com.bea.console.actions.jdbc.datasources.createjdbcdatasource.CreateJDBCDataSource.testConnectionConfiguration(CreateJDBCDataSource.java:450)
    sun.reflect.GeneratedMethodAccessor196.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
    org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
    org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
    org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
    Please help.
    Thanks

  • DB2 Connection Problem - Can't find - COM.ibm.db2.jdbc.app.DB2Driver

    Hi All,
    when executing an application and attempting to connect to DB2 I get;
    error java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver
    I've added the 'db2java.zip' library to the java.conf file (and the native db2 libs) and can make db2 connections using the database connect via the IDE. But not when executing my application - what am I missing.
    TIA
    Bill

    Hi Deepak,
    I added the db2java.zip to the
    project properties/libraries/classpath
    and it works fine. (well my code fails - but that's another problem <g>.)
    Thanks for all your help.
    Bill

  • Applet using COM.ibm.db2.jdbc.app.DB2Driver

    Hi,
    I have an applet that is downloaded from a webserver which then needs to access the local db2java.zip file. It was my understanding if you use the COM.ibm.db2.jdbc.app.DB2Driver it would allow you to access the local copy of that file in your classpath. I also understand that if you use COM.ibm.db2.jdbc.net.DB2Driver you can access the db2java.zip on the server. I unfortunately need to access the local db2java.zip file. I am upgrading from Java 1.2.2 to Java 1.3.1 and it is not allowing this connection. I also changed my java.policy file and have created my own certificate as well, I understand all that.
    Here is the section of my code that fails...
    java.sql.Driver d = (java.sql.Driver) Class.forName(getDriver()).newInstance();
    WHSConnection.con = DriverManager.getConnection(getURL(), getUser(), getPassword());
    WHSConnection.con.setAutoCommit(true);
    System.out.println("Database Connection Successful");
    } catch (java.lang.Throwable except) {
    except.printStackTrace();
    System.out.println("Database Connection Failed");
    Any suggestions would be appreciated. Thanks ~A

    Yes, I forgot to mention that I stopped all DB2 Services and ran the file "runjdbc2.bat"... When I run Java 1.2.2 everything works great. When I run 1.3.1 it attempts to locate the db2java.zip classes on the server and not locally... Here is the error message I receive...
    java.lang.ClassNotFoundException: java.io.FileNotFoundException: http://www.example.com/Java131/COM/ibm/db2/jdbc/app/DB2Driver.class
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
         at sun.plugin.protocol.jdk12.http.HttpURLConnection.checkCookieHeader(Unknown Source)
         at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.HttpURLConnection.getResponseCode(Unknown Source)
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at Serverlet.WHSConnection.getConnection(WHSConnection.java:159)
         at Serverlet.MainApplet.onOk(MainApplet.java:522)
         at Serverlet.MainApplet.connEtoM1(MainApplet.java:60)
         at Serverlet.MainApplet.actionPerformed(MainApplet.java:29)
         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.AWTEventMulticaster.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.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.run(Unknown Source)
    Database Connection Failed

  • Getting class (COM.ibm.db2.jdbc.app.DB2Connection)

    We are migrating from Websphere 3.5 to 4.0 and I am setting up my WSAD 4.0 on my local system. DB2 7.2 is the database for the application.
    When i configure the Data Source, all works fine, but when I run the application, i get the following error.
    The class (COM.ibm.db2.jdbc.app.DB2Connection) does not implement javax.sql.ConnectionPoolDataSource or javax.sql.XADataSource
    My JDBC driver is in the file db2java.zip. Can anyone tell me what is the way to remove this error and If i need to download some new drivers, where can i get them from?

    sorry to say this but we also fed up with all those things and using db2 is 1 of the worst thing in the world if u get enough help from anywhere.. plz inform me also...

  • Com.ibm.db2.jdbc.app.DB2DBException

    Hi,
    Iam trying to upload a .csv file into DB2(AS400).After 256th row in csv file iam getting the following exception.pls help me as to how to take care.
    the number of rows i wish to uplaod are 897.
    iam using javazoom.upload.UploadBean for uploading
    thanks in advance
    Gowri

    Hello Ashvini,
    Can you answer the simple questions:
    1. Are you able to upload smaller files into Database?
    2. For huge files, are u able to write the file localay in the server and see the entire contents?
    3. Can you post the entire stack trace?
    4. Did you check Google?
    Thanks and regards,
    Pazhanikanthan. P

  • TS1702 What's wrong with my ipad if the apps are not downloading

    I am trying to download some apps but all it says is "waiting" and I have been "waiting" for about an hour.  I do not have any (other) apps downloading except for the ones I am having problems with. Please help whenever possible.

    I have posted these suggestions many times and some of them have worked for other users in the past. Give them a try - in the order that they are typed below. Maybe something will work for you.
    1. Tap the "waiting" icon and see if you can pause it. If it does pause, then tap it again and see if it will resume. If that works, repeat the same steps for each "waiting" icon.
    2. Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    3. Make sure that you do not have a stalled download in iTunes - a song or podcast .... if you have a download in there that did not finish, complete that one first. Only one thing can download at a time on the iPad so that could be what is causing the problem.
    4. If that doesn't work - sign out of your account, restart the iPad and then sign in again.
    Settings>iTunes & App Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>iTunes & App Store>Sign in and then try to update again. Tap one waiting icon only if necessary to start the download stream.
    5. You can also try deleting the waiting icons - tap and hold down on an icon until it wiggles - the tap the X on the icon to delete it. Then try to download again.
    6. You can try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your device settings again.... All of the settings in the settings app will have to be re-entered.
    7. If all else fails, download the updates or the apps in iTunes on your computer and then sync the content to your iPad.

  • Jdbc.app.DB2Driver ? class not found

    in my code i have a string
    private static String COM_IBM_DB2_JDBC_APP_DB2DRIVER = COM.ibm.db2.jdbc.app.DB2Driver;and my connection code
                                       Connection conn;
                                       Class.forName(COM_IBM_DB2_JDBC_APP_DB2DRIVER).newInstance();
                                       conn = DriverManager.getConnection(JDBC_DB2 + SERVER, USERID, PWD);when i run my code i get this error
    java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2DriverClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver
         at java.net.URLClassLoader.findClass(URLClassLoader.java:241)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:516)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:460)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:448)
         at java.lang.Class.forName0(Native Method)
         at main(testCon.java(Compiled Code))
    i am not sure why i get the error. im my CLASSPATH i have
    C:\SQLLIB\java\db2java.zip;
    where the driver is.
    any suggestions on what else i am missing?? thanks in advance
    annie

    I had the same problem. But I was compiling and running code at command line on Windows XP.
    My db2java.zip was located here C:\Program Files\some_folder\SQLLIB\java\ and jxl.jar was located somewhare else.
    In order to keep all these files in one place, I created a folder "D:/classes" and added db2java.zip and jxl.jar to it.
    Then set the classpath like this set CLASSPATH=D:\classes\jxl.jar;D:\classes\db2java.zip;.
    Now everything works fine. No more class not found errors.

  • My iPhone 5 screen is black and will not come back on. The phone still works when paired with my vehicles Bluetooth what's wrong with it, and can I fix it?

    My iPhone 5 screen is black and will not come back on. The phone still works when paired with my vehicles Bluetooth what's wrong with it, and can I fix it?

    I have a similar problem.  I restored my iPhone 5 to the latest available OS.  After completing the process the phone never restarted.  The phone was fully charged when I restored it but now refuses to charge past the red battery icon.  I have been able to get the phone in UFD mode several times and have been able to load the new OS on the phone.  The Apple logo does come on and the software fully loads.  iTunes tells me the phone will restart but never does.  I left it to charge all night but it never appeared to load the battery.  This morning I went to the Grand Central Terminal apple store for help.  A woman at the store plugged the phone in but it never charged.  She absolutely refused to believe that I got my phone in UFD mode and loaded any software on.  I don't think it is a battery issue.  The only solution I was given was to buy a new phone.  Repairing it was out of the question.  At this point the phone is completely useless.  Thanks in advance for the help.

  • Hey my air's screen is mess when it comes back from sleep. It is full of horizontal  colorful lines. However, it becomes ok when I restart it. What's wrong with it?

    Hey my air's screen is mess when it comes back from sleep. It is full of horizontal  colorful lines. However, it becomes ok when I restart it. What's wrong with it?

    Resetting PRAM may help.
    Reset PRAM.  http://support.apple.com/kb/PH4405

  • How come I can't download (buy) music with my account? What is wrong with it?

    How come I can't download (buy) music with my account? What is wrong with it?

    They could barely be more vague.
    How could anyone possibly help with no information at all about your issue?

  • Com.ibm.db2.jcc.b.SqlException: DB2 SQL Error: SQLCODE=-973, SQLSTATE=00000

    Hi,
    We are running WebLogic 10.3.0 on RHEL 5.3 with JRockit JDK 1.6 and DB2 Version 8 on mainframe running z/OS 1.9.
    We are getting below exception in webLogic logs from connection pool connecting to DB2 database.
    >
    ####<Jul 23, 2010 10:05:49 AM EDT> <Warning> <JDBC> <testing.us.test.net> <testingDB2> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1279893949615> <BEA-001129> <Received exception while creating connection for pool "TestDB2Pool": DB2 SQL Error: SQLCODE=-973, SQLSTATE=00000, SQLERRMC=MON_HEAP_SZ, DRIVER=3.53.70>
    ####<Jul 23, 2010 10:05:49 AM EDT> <Info> <JDBC> <testing.us.test.net> <testingDB2> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1279893949616> <BEA-001156> <Stack trace associated with message 001129 follows:
    com.ibm.db2.jcc.b.SqlException: DB2 SQL Error: SQLCODE=-973, SQLSTATE=00000, SQLERRMC=MON_HEAP_SZ, DRIVER=3.53.70
         at com.ibm.db2.jcc.b.bd.a(bd.java:679)
         at com.ibm.db2.jcc.b.bd.a(bd.java:60)
         at com.ibm.db2.jcc.b.bd.a(bd.java:127)
         at com.ibm.db2.jcc.b.jb.a(jb.java:4016)
         at com.ibm.db2.jcc.t4.bb.l(bb.java:403)
         at com.ibm.db2.jcc.t4.bb.d(bb.java:141)
         at com.ibm.db2.jcc.t4.b.Oc(b.java:1305)
         at com.ibm.db2.jcc.t4.b.b(b.java:1225)
         at com.ibm.db2.jcc.t4.b.B(b.java:5129)
         at com.ibm.db2.jcc.t4.b.c(b.java:783)
         at com.ibm.db2.jcc.t4.b.b(b.java:726)
         at com.ibm.db2.jcc.t4.b.a(b.java:409)
         at com.ibm.db2.jcc.t4.b.<init>(b.java:345)
         at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:197)
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.java:316)
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:217)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1109)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1033)
         at weblogic.common.resourcepool.ResourcePoolImpl.createResources(ResourcePoolImpl.java:574)
         at weblogic.jdbc.wrapper.Connection.run(Connection.java:268)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    >
    Below is snippet of my datasource configuration.
    <?xml version='1.0' encoding='UTF-8'?>
    <jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/jdbc-data-source" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/jdbc-data-source http://www.bea.com/ns/weblogic/jdbc-data-source/1.0/jdbc-data-source.xsd">
    <name>TestingDB2</name>
    <jdbc-driver-params>
    <url>jdbc:db2://DB2.testing.us.com:50003/TestingDB</url>
    <driver-name>com.ibm.db2.jcc.DB2Driver</driver-name>
    <properties>
    <property>
    <name>maxRetriesForClientReroute</name>
    <value>2</value>
    </property>
    <property>
    <name>retryIntervalForClientReroute</name>
    <value>5</value>
    </property>
    <property>
    <name>user</name>
    <value>testuser</value>
    </property>
    <property>
    <name>resultSetHoldability</name>
    <value>2</value>
    </property>
    <property>
    <name>enableSysplexWLB</name>
    <value>true</value>
    </property>
    <property>
    <name>enableConnectionConcentrator</name>
    <value>true</value>
    </property>
    <property>
    <name>databaseName</name>
    <value>DB2QA</value>
    </property>
    <property>
    <name>maxTransportObjects</name>
    <value>108</value>
    </property>
    </properties>
    <password-encrypted>{3DES}eh4WI16Xb8E=</password-encrypted>
    </jdbc-driver-params>
    <jdbc-connection-pool-params>
    <initial-capacity>40</initial-capacity>
    <max-capacity>215</max-capacity>
    <capacity-increment>1</capacity-increment>
    <shrink-frequency-seconds>300</shrink-frequency-seconds>
    <highest-num-waiters>2147483647</highest-num-waiters>
    <connection-creation-retry-frequency-seconds>15</connection-creation-retry-frequency-seconds>
    <connection-reserve-timeout-seconds>10</connection-reserve-timeout-seconds>
    <test-frequency-seconds>300</test-frequency-seconds>
    <test-connections-on-reserve>true</test-connections-on-reserve>
    <ignore-in-use-connections-enabled>true</ignore-in-use-connections-enabled>
    <inactive-connection-timeout-seconds>300</inactive-connection-timeout-seconds>
    <test-table-name>SYSIBM.SYSDUMMY</test-table-name>
    <login-delay-seconds>1</login-delay-seconds>
    <statement-cache-size>300</statement-cache-size>
    <statement-cache-type>LRU</statement-cache-type>
    <remove-infected-connections>true</remove-infected-connections>
    <seconds-to-trust-an-idle-pool-connection>15</seconds-to-trust-an-idle-pool-connection>
    <statement-timeout>-1</statement-timeout>
    <pinned-to-thread>false</pinned-to-thread>
    </jdbc-connection-pool-params>
    <jdbc-data-source-params>
    <jndi-name>TestingDB2</jndi-name>
    <global-transactions-protocol>None</global-transactions-protocol>
    </jdbc-data-source-params>
    </jdbc-data-source>
    Please help me on this.
    - BoyelT

    Thanks Joe. I will test the standalone client program you provided.
    Below are links I found on web on SQL CODE -972 error message
    http://www.dbforums.com/db2/875633-sqlcode-973-sqlstate-57011-drda_heap_sz-cobol-db2-error.html
    http://publib.boulder.ibm.com/infocenter/tivihelp/v4r1/index.jsp?topic=/com.ibm.tpc_V411.doc/fqz0_r_tbs_db2_sql_973.html
    http://www-01.ibm.com/support/docview.wss?uid=swg1IY55389
    Below is explanation about this message
    ===============================================
    SQL0973N Not enough storage is available in the "<heap-name>" heap to process the statement.
    Explanation: All available memory for this heap has been used. The statement cannot be processed.
    User Response: Terminate the application on receipt of this message (SQLCODE). Increase the configuration parameter for "<heap-name>" to increase the heap size.
    ===============================================
    Can you please advise if this is the problem from DBMS side?

  • What's wrong with my code for comparing date retreived from db and sysdate?

    Hi all,
    I need to retrive date from the DB and compare it to system date.i have posted the code below.i get java.sql.SQL Exception:Io exception:Socket closed.
    What's wrong with the code?please help me.Thanks in advance.
    public boolean date() throws IOException, SQLException {
    Connection con1;
    long millis = System.currentTimeMillis();
    Timestamp timestamp = new java.sql.Timestamp(millis);
    ResultSet rs4 = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection(
    "jdbc:oracle:thin:@abc:1605:xyz",
    "cdf", "cdf");
    Statement stmt_exp = con.createStatement();
    rs4 = stmt_exp.executeQuery("SELECT DATE FROM TABLE_NAME")
    while (rs4.next()) {
    Timestamp timestamp2 = rs4.getTimestamp("expire_date");
    con1.close();
    catch (Exception e)
    e.printStackTrace();
    finally
    //ResultSet rs4 = null;
    //Timestamp timestamp2;
    Timestamp timestamp2 = rs4.getTimestamp("expire_date");
    if (timestamp2.compareTo(timestamp) < 0)  //sysdate < exp date
    return true;
    } else {
    return false;
    }

    Didn't you understand what BalusC said? You're closing the connection and then trying to use the ResultSet. The ResultSet will be closed when you close the connection so you can't use it anymore.
    You should close the connection last thing in your code, probably in a finally. And after you close your ResultSet and Statement.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

Maybe you are looking for