JDBC Driver type 4 for DB2 8.1

JDBC Driver type 4 for DB2 8.1

Post by Franco Lombard » Fri, 06 Jun 2003 01:58:51



I'm using type 4 JDBC driver (1.1.67) to access DB2 NT 8.1.

When I get an SQLException I can't retrive a meaningfull error
message, neither using the toString() method, nor using getMessage().
All I can get is something like
"DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: xyz"
Is it impossible to obtain something like
"Wrong statement: non existing table xyz"?

Thanks

Bye

Franco

 
 
 

JDBC Driver type 4 for DB2 8.1

Post by pm3iinc-nospa » Fri, 06 Jun 2003 08:39:56


V8 FP 2
FP2_WR21318\Release.Notes

Full message text is not returned when using SQLException.getMessage()

By default, the DB2BaseDataSource.retrieveMessagesFromServerOnGetMessage
property is disabled. If you enable this property, all calls to the
standard JDBC SQLException.getMessage() invoke a server-side stored
procedure, which retrieves the readable message text for the error. By
default, the full message text is not returned to the client when a
server-side error occurs.

You can use the proprietary method DB2Sqlca.getMessage() to retrieve the
fully formatted message text. A call to the SQLException.getMessage()
method will start a unit of work only if
retrieveMessagesFromServerOnGetMessage is enabled. A call to the
DB2Sqlca.getMessage() method results in a stored procedure call, which
starts a unit of work. Prior to FixPak 1, the DB2Sqlca.getMessage()
method may throw an exception.

PM

 
 
 

JDBC Driver type 4 for DB2 8.1

Post by Franco Lombard » Fri, 06 Jun 2003 17:56:09


Thanks a lot: it works fine.

Bye

Franco

 
 
 

1. db2 version 8.1 jdbc universal driver

i am able to install db2 v8.1 on my  window 2000  machine. and use
type 4 driver which come with installation com.ibm.db2.jcc.DB2Driver,
i have a client try to start an app server on his machine and
connection to my machine which is db server to retrive data with
coding

Class.forName(jdbcDriver);
catalogConn = DriverManager.getConnection(Url, username, password);

the url is jdbc:db2://172.16.4.86:50000/hd1100pd, but got below error,

CLI0616E Error opening socket.  

Explanation: Cannot open the socket to server, server may be down.

but if i using the same coding and start the app server on my machine,
i have no problem connect to database. why is that?

2. EXP-00003: no storage definition found for segment(1, 50602)

3. DB2 8.1 JDBC driver - Linux JDK1.4 support?

4. Permission Requirements for upsizing records to SQL Server

5. anybody sucessful with suse 8.1 and db2 8.1?

6. Free OLE Object Browser Demo! Not crippled!

7. DB2 UDB LUW 8.1: type-2 index reporting with system catalogs

8. Trigger Problem ORA-04091

9. jdbc connection error with DB2 8.1 64-bit client

10. Developing IBMVA JDBC with NT DB2 driver to run on OS390 DB2 driver

11. DB2 V8 for z/OS JDBC Type-4 Driver

12. DB2 V8.1 and JDBC Type 4 driver error