Topic
  • 2 replies
  • Latest Post - ‏2007-07-24T02:12:00Z by kmarthi
kmarthi
kmarthi
2 Posts

Pinned topic Derby and ODBC (DB2 Run-Time Client)

‏2007-07-21T00:19:41Z |
Hi,

Apologies for what might be a trivial question... I am a new user of Derby with previous DB2 experience... I am trying to use Derby with the DB2 Run-Time Client. The goal is to be able to use Derby from C/C++ via unixODBC.

As first steps, I have followed the instructions given in http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/ and the readme_linux.txt of the DB2 Run-time Client.
Elsewhere in this forum, there were instructions on using the DB2 Run-Time Client which I followed to the letter also. However, I invariably end up with this error...

db2 => connect to testdb user usr using pwd
[b]
SQL30061N The database alias or database name "TESTDB " was not
found at the remote node. SQLSTATE=08004
[/b]

I would very much appreciate any help that you can offer. Thank you.

Details follow.
====================================================
loadl@c197blade1b05 bin$ sysinfo

Java Information
Java Version: 1.4.2
Java Vendor: IBM Corporation
Java home: /opt/IBMJava2-142/jre
Java classpath: /opt/Derby_10/lib/derby.jar:/opt/Derby_10/lib/derbynet.jar:/opt/Derby_10/lib/derbytools.jar:/opt/Derby_10/lib/derbyclient.jar:/opt/Derby_10/lib/derbytools.jar:/opt/IBMJava2-142/jre/lib:/opt/Derby_10/lib/derbynet.jar:/opt/Derby_10/lib/derby.jar:/home/loadl/sqllib/java/db2java.zip:/home/loadl/sqllib/java/db2jcc.jar:/home/loadl/sqllib/java/sqlj.zip:/home/loadl/sqllib/function:/home/loadl/sqllib/java/db2jcc_license_cu.jar:.
OS name: Linux
OS architecture: x86
OS version: 2.6.9-11.ELsmp
Java user name: loadl
Java user home: /home/loadl
Java user dir: /opt/Derby_10/bin
java.specification.name: Java Platform API Specification
java.specification.version: 1.4

Derby Information
JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
[/opt/Derby_10/lib/derby.jar] 10.2.2.0 - (485682)
[/opt/Derby_10/lib/derbytools.jar] 10.2.2.0 - (485682)
[/opt/Derby_10/lib/derbynet.jar] 10.2.2.0 - (485682)
[/opt/Derby_10/lib/derbyclient.jar] 10.2.2.0 - (485682)
[/opt/IBM/db2/V8.1/java/db2jcc.jar] 2.3 - (63)
[/opt/IBM/db2/V8.1/java/db2jcc_license_cu.jar] 2.3 - (63)


Locale Information
Current Locale : [English/United States en_US]
Found support for locale: cs
version: 10.2.2.0 - (485682)
Found support for locale: de_DE
version: 10.2.2.0 - (485682)
Found support for locale: es
version: 10.2.2.0 - (485682)
Found support for locale: fr
version: 10.2.2.0 - (485682)
Found support for locale: hu
version: 10.2.2.0 - (485682)
Found support for locale: it
version: 10.2.2.0 - (485682)
Found support for locale: ja_JP
version: 10.2.2.0 - (485682)
Found support for locale: ko_KR
version: 10.2.2.0 - (485682)
Found support for locale: pl
version: 10.2.2.0 - (485682)
Found support for locale: pt_BR
version: 10.2.2.0 - (485682)
Found support for locale: ru
version: 10.2.2.0 - (485682)
Found support for locale: zh_CN
version: 10.2.2.0 - (485682)
Found support for locale: zh_TW
version: 10.2.2.0 - (485682)

loadl@c197blade1b05 bin$ java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM build cxia32142-20060421 (SR5) (JIT enabled: jitc))
loadl@c197blade1b05 bin$ db2level
DB21085I Instance "loadl" uses "32" bits and DB2 code release "SQL08020" with
level identifier "03010106".
Informational tokens are "DB2 v8.1.0.64", "s040812", "MI00086", and FixPak "7".
Product is installed at "/opt/IBM/db2/V8.1".

loadl@c197blade1b05 bin$ db2 => catalog tcpip node supermax remote 127.0.0.1 server 1527
DB20000I The CATALOG TCPIP NODE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.
db2 => catalog db testdb at node supermax authentication server
DB20000I The CATALOG DATABASE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.
db2 => connect to testdb user usr using pwd
SQL30061N The database alias or database name "TESTDB " was not
found at the remote node. SQLSTATE=08004
db2 => list database directory

System Database Directory

Number of entries in the directory = 1

Database 1 entry:

Database alias = TESTDB
Database name = TESTDB
Node name = SUPERMAX
Database release level = a.00
Comment =
Directory entry type = Remote
Authentication = SERVER
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =

db2 =>
Output from server window:
root@c197blade1b05 ~# java -jar $DERBY_HOME/lib/derbynet.jar start
Apache Derby Network Server - 10.2.2.0 - (485682) started and ready to accept connections on port 1527 at 2007-07-20 22:08:26.695 GMT
Updated on 2007-07-24T02:12:00Z at 2007-07-24T02:12:00Z by kmarthi
  • Stan
    Stan
    267 Posts

    Re: Derby and ODBC (DB2 Run-Time Client)

    ‏2007-07-23T20:36:33Z  
    Hi -

    I seem to recall that, on LINUX / UNIX the database needs to be created/named using upper case letters and must reside in the default directory (derby.system.home) of the Network Server. Check that the DB directory is in the same location that derby.log is created when Network Server is started and that a directory listing shows the folder as TESTDB (uppercase). If this is not the problem let me know and I will so addtional research.
  • kmarthi
    kmarthi
    2 Posts

    Re: Derby and ODBC (DB2 Run-Time Client)

    ‏2007-07-24T02:12:00Z  
    • Stan
    • ‏2007-07-23T20:36:33Z
    Hi -

    I seem to recall that, on LINUX / UNIX the database needs to be created/named using upper case letters and must reside in the default directory (derby.system.home) of the Network Server. Check that the DB directory is in the same location that derby.log is created when Network Server is started and that a directory listing shows the folder as TESTDB (uppercase). If this is not the problem let me know and I will so addtional research.
    Thanks! Once I created the database in all uppercase, it did the trick. Thanks for your timely and accurate response.