?
Solved

Database Connection Failure

Posted on 2003-03-04
6
Medium Priority
?
6,934 Views
Last Modified: 2007-12-19
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.

0
Comment
Question by:k_murli_krishna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 17

Author Comment

by:k_murli_krishna
ID: 8064193
Please have a look at my other questions: 'Configuration, implementation and programs','URGENT - EXPORT IMPORT PROBLEM'
0
 
LVL 13

Expert Comment

by:ghp7000
ID: 8072147
>>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
0
 
LVL 17

Author Comment

by:k_murli_krishna
ID: 8111446
ghp7000 - sorry i was busy. will post the error message in db2diag.log in a day or two.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 17

Author Comment

by:k_murli_krishna
ID: 8229852
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
 
0
 
LVL 13

Accepted Solution

by:
ghp7000 earned 400 total points
ID: 8246294
um, this doesnt seem to be the same problem as the original post. Are you saying that you have SPB installed on a workstation and you are using SPB to try and connect to a database on a remote server and when you try and do this you get the error described in your last post?
In any case, the problem you report in your last post-have you created an identical function named RTRIM in another schema? Are you sure that the stored procedure named SQL030228162818050 still exists on the server where it weas created? Note that if you dont specifically name your stored procedures, db2 names it for you using this sql#, so its better to use a SPECIFINAME if for nothing else than to help you resolve these types of problems. Finally, check the sql function path on the client side by issuing db2 values (current path). You can also drop the SPB connection to the database (from within SPB), exit SPB, reopen SPB, re insert the db connection and see if that will resolve your problem.
0
 
LVL 1

Expert Comment

by:shirras
ID: 8256907
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.

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question