*
The moose likes JDBC and the fly likes Works with JDBC/ODBC but not Direct JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Works with JDBC/ODBC but not Direct JDBC " Watch "Works with JDBC/ODBC but not Direct JDBC " New topic
Author

Works with JDBC/ODBC but not Direct JDBC

Salman Yasser
Greenhorn

Joined: Aug 22, 2002
Posts: 25
I connect to DB2 UDB 7.1.1, on Z/OS 1.4

When using the ODBC defiened on my PC it works successfully
public final String DB_URL = "jdbc : db2 : ODBC_NAME";
public final String DB_DRIVER = "COM.ibm.db2.jdbc.app.DB2Driver";

While null is retrieved from the direct connection to the Database on server
public final String DB_URL = "jdbc : db2 : // 196.15.32.80:446/DATABASE_NAME";
public final String DB_DRIVER = "COM.ibm.db2.jdbc.net.DB2Driver";

What is the problem with JDBC direct connection?
Salman Yasser
Greenhorn

Joined: Aug 22, 2002
Posts: 25
This is the SQL Exception I got:
[IBM][JDBC Driver] CLI0615E Error receiving from socket, server is not responding. SQLSTATE=08S01
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Do you provide a correct connection string, username and password?
If all the above are correct, is the machine running the database server set up to deny external access except from a limited number of IP addresses?
If that's OK, is the machine running any addons to DB2 required to accept JDBC requests?


42
Salman Yasser
Greenhorn

Joined: Aug 22, 2002
Posts: 25
The user name, password url and DB Name are right, I actually use them to define the ODBC or through DB2 Connect and running perfectly.
No limitations are defined on the server for IPs.
What do you mean by Addons?
I cannot get what do you mean by: (addons to DB2 required to accept JDBC requests)
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

which driver are you using? Is this a thick client, servlet, web or applet doing the JDBC call?
This is what some of the documentation recommended for this error:
CLI0615E Error receiving from socket, server is not responding.
Explanation: Error happened while receiving from server, server may be down.
User Response: Ensure JDBC server is up, and rerun your program.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by Jamie Robertson:
which driver are you using? Is this a thick client, servlet, web or applet doing the JDBC call?
This is what some of the documentation recommended for this error:
CLI0615E Error receiving from socket, server is not responding.
Explanation: Error happened while receiving from server, server may be down.
User Response: Ensure JDBC server is up, and rerun your program.

I guess that doesn't make much sense if your ODBC connection works???
It would also help if you posted the full Connection code.
Jamie
Salman Yasser
Greenhorn

Joined: Aug 22, 2002
Posts: 25
I run only a standalone application without web server, and it works using client assistent configuration to define the connection to database but does not work with direct JDBC connection.
This is my code for connection:
USER_NAME = "aciswf1";
PASSWORD = "123456";
DB_URL = "jdbc : Db2 : / / 196.15.32.80:446 / ZOSDB2";
DB_DRIVER = "COM.ibm.db2.jdbc.net.DB2Driver";
Driver d = (Driver)Class.forName( p_szDbDriverClass ).newInstance();
return ( DriverManager.getConnection( p_szDbUrl,
p_szDbUserName,
p_szDbUserPassword ) );
When changeing the driver to be App driver, with connection to ODBC defined at Client Configuration Assistent it works perfectly
DB_URL = "jdbc : Db2 : ZOSDB2";
DB_DRIVER = "COM.ibm.db2.jdbc.app.DB2Driver";
While it doesn't with Net driver with connection to Database at DB2 server directly
[ March 17, 2004: Message edited by: Salman Yasser ]
Salman Yasser
Greenhorn

Joined: Aug 22, 2002
Posts: 25
I want to connect to DB2 server without installing DB2 client on the client, or at least without configuring a connection to DB2 database through Client Configuration Assistant.
Just JDBC connection with a suitable driver
Is that possible?
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by Salman Yasser:
I want to connect to DB2 server without installing DB2 client on the client, or at least without configuring a connection to DB2 database through Client Configuration Assistant.
Just JDBC connection with a suitable driver
Is that possible?
It is available and reliable! download the JTOpen drivers for DB2. It is a free type 4 driver recommended by IBM ( other than the IBM toolbox for java! )
 
Consider Paul's rocket mass heater.
 
subject: Works with JDBC/ODBC but not Direct JDBC