Link to home
Start Free TrialLog in
Avatar of k_murli_krishna
k_murli_krishnaFlag for India

asked on

Database Connection Failure

DB2 7.2 EE server I:

/**
 * SQLJ Stored Procedure DB2ADMIN.SQLJSAMPLEPROC1
 */
import java.sql.*;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;
 
 public class JavaSQLJInsertCus
 {
 public static void JavaSQLJInsertCus (String s1, String s2)throws SQLException, Exception
 {
 Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance ();
    Connection con = DriverManager.getConnection("jdbc:db2:sample","db2admin","db2admin");
     // Set the default context
    DefaultContext ctx = new DefaultContext(con);            
    DefaultContext.setDefaultContext(ctx);
    #sql { INSERT INTO TABLE1 VALUES(:s1,:s2) };
    System.out.println("Insertion is over.......");
   }
}
When I run the above code using the DB2 Stored Procedure Builder the database connection is failing since database manager for instance DB2 in remote server auto stops and error alert pops up with message:

db2syscs.exe has generated errors and will be closed by windows. You will need to restart the program.

An error log is being created. Is this db2diag.log.

DB2 7.2 EE server II:

Same program as above when run in stored procedure builder leads to below error while database manager for instance DB2 auto stops:

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL30081N  A communication error has been detected.  Communication protocol being used: "TCP/IP".  Communication API being used: "SOCKETS".  Location where the error was detected: "12.16.12.82".  Communication function detecting the error: "recv".  Protocol specific error code(s): "10054", "*", "0".  SQLSTATE=08001

JDBC IN ADMIN CLIENTS STORED PROCEDURE BUILDER TO SAME 2 SERVERS RUNS OKAY.

Since similar problem if not same from stored procedure builder in admin client to remote servers, cannot understand where problem lies. Please help & thanks in advance.

Avatar of k_murli_krishna
k_murli_krishna
Flag of India image

ASKER

Please have a look at my other questions: 'Configuration, implementation and programs','URGENT - EXPORT IMPORT PROBLEM'
Avatar of ghp7000
ghp7000

>>An error log is being created. Is this db2diag.log.

No, this Dr Watson from Windows OS. Increase the diagnostic level of the db to 4 if not already at that level. Run the stored proc again and post the error message that is in db2diag.log.
--update dbm cfg using diaglevel 4
ghp7000 - sorry i was busy. will post the error message in db2diag.log in a day or two.
ghp7000: I increased diagnostic level of DB to 4. Now when my colleague tries to log in into stored procedure builder to same old database the following error is thrown:
Failure to get stored-procedure information
SELECT PP.ORDINAL, PP.TYPESCHEMA, PP.TYPENAME, PP.LENGTH, PP.SCALE, PP.PARM_MODE, PP.PARMNAME, PP.CODEPAGE, DT.METATYPE, DT.SOURCESCHEMA, DT.SOURCENAME, DT.REMARKS, DT.LENGTH, DT.SCALE FROM SYSCAT.PROCPARMS AS PP LEFT OUTER JOIN SYSCAT.DATATYPES AS DT ON ( SYSFUN.RTRIM(PP.TYPESCHEMA) = SYSFUN.RTRIM(DT.TYPESCHEMA) AND PP.TYPENAME = DT.TYPENAME ) WHERE SPECIFICNAME = 'SQL030228162818050'
[IBM][CLI Driver][DB2/NT] SQL0440N  No function by the name "RTRIM" having compatible arguments was found in the function path.  SQLSTATE=42884
 
ASKER CERTIFIED SOLUTION
Avatar of ghp7000
ghp7000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To answer your question a little easier...RTRIM (the function called to remove trailing blanks) is not part of the SYSFUN schema as you are calling it, it is actually part of the SYSIBM schema and should be qualified as such (SYSIBM.RTRIM()). For more information on the functions and what schemas they belong to, see page 210 of the SQL Reference, Volume 1.
Hope this helps to clarify.