473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Schemacrawler and DB2

Hi !

I'm currently trying to read out ddl-structures from a db2-database
with schemacrawler (http://schemacrawler.sourceforge.net/)
but without success. Some people in this newsgroup recommended this
tool for analyzing and diff-ing ddl-structures of databases.

My configuration looks like this:
---
.....
vk1xap04.host=127.0.0.1
vk1xap04.port=60020
vk1xap04.database=vk1xap04
vk1xap04.schemapattern=%
vk1xap04.user=vk1xap04
vk1xap04.password=<removed>
vk1xap04.driver=com.ibm.db2.jcc.DB2Driver
vk1xap04.url=jdbc:db2://${host}:${port}
....
---

I got the following error-message:
--
$ java -cp $CLASSPATH -jar `ls -1 schemacrawler-*.jar` \
-command=maximum_schema \
-outputformat=text \
-g /application/shared/install/schemacrawler/current/schemacrawler.config.properties \
-connection=vk1xap04

exception in thread "main" dbconnector.datasource.PropertiesDataSourceExcepti on: Driver class not found - com.ibm.db2.jcc.DB2Driver
at dbconnector.datasource.PropertiesDataSource.constr uctPropertiesDataSource(PropertiesDataSource.java: 202)
at dbconnector.datasource.PropertiesDataSource.<init> (PropertiesDataSource.java:153)
at dbconnector.Main.createDataSource(Main.java:215)
at schemacrawler.Main.doMain(Main.java:117)
at schemacrawler.Main.main(Main.java:82)
Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at dbconnector.datasource.PropertiesDataSource.constr uctPropertiesDataSource(PropertiesDataSource.java: 197)
... 4 more
--

This looks like a simple classpath problem - but the class is resolvable:
---
# positive test
java com.ibm.db2.jcc.DB2Driver
Exception in thread "main" java.lang.NoSuchMethodError: main
# negative test
java com.ibm.db2.jcc.DB2DriverXXXXXXXXXXX
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/db2/jcc/DB2DriverXXXXXXXXXXX
---

Any ideas ?

Is there a another free tool which eases comparison of databases ?

Best regards

Marc Schoechlin
--
I prefer open/free file formats:
http://en.wikipedia.org/wiki/Open_fo...f_open_formats
http://en.wikipedia.org/wiki/Free_file_format
Dec 14 '06 #1
3 5149
Your problem is shown in the first line of the error message - the type
4 jcc driver wasn't found.

Make sure that the *.jcc.jar file appears in your CLASSPATH. On my
system it's located at:
/home/db2inst1/sqllib/java/db2jcc.jar

If you properly executed the instance owner's db2profile script, you
should have had this included in your CLASSPATH variable. It's one of a
number of db2 items in the classpath.

Phil Sherman
Marc Schoechlin wrote:
Hi !

I'm currently trying to read out ddl-structures from a db2-database
with schemacrawler (http://schemacrawler.sourceforge.net/)
but without success. Some people in this newsgroup recommended this
tool for analyzing and diff-ing ddl-structures of databases.

My configuration looks like this:
---
....
vk1xap04.host=127.0.0.1
vk1xap04.port=60020
vk1xap04.database=vk1xap04
vk1xap04.schemapattern=%
vk1xap04.user=vk1xap04
vk1xap04.password=<removed>
vk1xap04.driver=com.ibm.db2.jcc.DB2Driver
vk1xap04.url=jdbc:db2://${host}:${port}
...
---

I got the following error-message:
--
$ java -cp $CLASSPATH -jar `ls -1 schemacrawler-*.jar` \
-command=maximum_schema \
-outputformat=text \
-g /application/shared/install/schemacrawler/current/schemacrawler.config.properties \
-connection=vk1xap04

exception in thread "main" dbconnector.datasource.PropertiesDataSourceExcepti on: Driver class not found - com.ibm.db2.jcc.DB2Driver
at dbconnector.datasource.PropertiesDataSource.constr uctPropertiesDataSource(PropertiesDataSource.java: 202)
at dbconnector.datasource.PropertiesDataSource.<init> (PropertiesDataSource.java:153)
at dbconnector.Main.createDataSource(Main.java:215)
at schemacrawler.Main.doMain(Main.java:117)
at schemacrawler.Main.main(Main.java:82)
Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at dbconnector.datasource.PropertiesDataSource.constr uctPropertiesDataSource(PropertiesDataSource.java: 197)
... 4 more
--

This looks like a simple classpath problem - but the class is resolvable:
---
# positive test
java com.ibm.db2.jcc.DB2Driver
Exception in thread "main" java.lang.NoSuchMethodError: main
# negative test
java com.ibm.db2.jcc.DB2DriverXXXXXXXXXXX
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/db2/jcc/DB2DriverXXXXXXXXXXX
---

Any ideas ?

Is there a another free tool which eases comparison of databases ?

Best regards

Marc Schoechlin
Dec 14 '06 #2
Phil Sherman <ps******@ameritech.netschrieb:
Your problem is shown in the first line of the error message - the type
4 jcc driver wasn't found.

Make sure that the *.jcc.jar file appears in your CLASSPATH. On my
system it's located at:
/home/db2inst1/sqllib/java/db2jcc.jar
This file was already in my classpath (you see this in the test
beyond) - but it was not enough to
set the classpath varaible or to add the classpath with
"java -cp jar1.jar:jar2.jar" ...
>This looks like a simple classpath problem - but the class is resolvable:
---
# positive test
java com.ibm.db2.jcc.DB2Driver
Exception in thread "main" java.lang.NoSuchMethodError: main
# negative test
java com.ibm.db2.jcc.DB2DriverXXXXXXXXXXX
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/db2/jcc/DB2DriverXXXXXXXXXXX
---
I tried an alternate way:
----
-------
CLASSPATH=/opt/IBM/db2/V8.1/java/db2java.zip:/opt/IBM/db2/V8.1/java/Common.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2fs.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2jcc.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2qgjava.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2policy.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2jcc_license_cisuz.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2jcc_javax.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2jcc_license_cu.jar
export CLASSPATH

java -cp `ls -1 schemacrawler-*.jar`:$CLASSPATH schemacrawler.Main \
-command=maximum_schema \
-outputformat=text \
-g /application/shared/install/schemacrawler/schemacrawler.config.properties \
-connection=$1
-------

Now i ran into another problem :-)

--- my config --------------------------------------------
vk1xap04.host=127.0.0.1
vk1xap04.port=60020
vk1xap04.database=vk1xap04
vk1xap04.schemapattern=vk1xap04
vk1xap04.user=vk1xap04
vk1xap04.password=<removed>
vk1xap04.driver=com.ibm.db2.jcc.DB2Driver
vk1xap04.url=jdbc:db2://${host}:${port}/${database}
---------------------------------------------------------

- error output ----------------------------------------------

-- database product: DB2/SUN SQL08024
-- driver: com.ibm.db2.jcc.DB2Driver - IBM DB2 JDBC Universal Driver
Architecture 2.8.46
-- connection: jdbc:db2://127.0.0.1:60020/vk1xap04
-- schema pattern: vk1xap04
------------------------------------------------------------------------
AllProceduresAreCallable false
AllTablesAreSelectable false
CatalogSeparator .
Exception in thread "main" java.lang.NullPointerException
at
schemacrawler.tools.schematext.BaseSchemaTextForma tter.handle(BaseSchemaTextFormatter.java:160)
at
schemacrawler.crawl.SchemaCrawler.crawlDatabaseInf o(SchemaCrawler.java:186)
at schemacrawler.crawl.SchemaCrawler.crawl(SchemaCraw ler.java:131)
at
schemacrawler.tools.ToolsExecutor.execute(ToolsExe cutor.java:126)
at schemacrawler.Main.doMain(Main.java:124)
at schemacrawler.Main.main(Main.java:82)
--------------------------------------------------------------------------

I´m have no idea how to solve this ....

Best regards

Marc Schoechlin

----

--
https://www.xing.com/profile/Marc_Schoechlin/
I prefer open/free file formats:
http://en.wikipedia.org/wiki/Open_fo...f_open_formats
http://en.wikipedia.org/wiki/Free_file_format
Contact me via jabber: ms@256bit.org
Dec 14 '06 #3
You apparently didn't look carefully at the error output. The initial
error message is SQL08024, with additional Java information showing the
Java stack trace. DB2 error messages can be looked up in the messages
manual, or, for a quick look, enter the command: db2 "? SQL08024"

The error message indicates that you've run into a licensing error. I'm
not sure what has happened at this point but you should check your
db2diag.log file for additional error information. Your configuration
states that you are using the loopback TCP/IP interface to connect to
the database so I'd suspect that the database is refusing to accept the
connection.

You could try a simple Java program (you write it) that connects to the
database and does a 'select count(*) from syscat.tables' to verify that
you can connect to the database and get something from it. Use the same
connection parameters; 127.0.0.1, port 60020, etc. and see if that
works. If it fails, you have a simple piece of code to experiment with
that you can easily modify.

Phil Sherman

Marc Schoechlin wrote:
Phil Sherman <ps******@ameritech.netschrieb:
>Your problem is shown in the first line of the error message - the type
4 jcc driver wasn't found.

Make sure that the *.jcc.jar file appears in your CLASSPATH. On my
system it's located at:
/home/db2inst1/sqllib/java/db2jcc.jar

This file was already in my classpath (you see this in the test
beyond) - but it was not enough to
set the classpath varaible or to add the classpath with
"java -cp jar1.jar:jar2.jar" ...
>>This looks like a simple classpath problem - but the class is resolvable:
---
# positive test
java com.ibm.db2.jcc.DB2Driver
Exception in thread "main" java.lang.NoSuchMethodError: main
# negative test
java com.ibm.db2.jcc.DB2DriverXXXXXXXXXXX
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/db2/jcc/DB2DriverXXXXXXXXXXX
---

I tried an alternate way:
----
-------
CLASSPATH=/opt/IBM/db2/V8.1/java/db2java.zip:/opt/IBM/db2/V8.1/java/Common.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2fs.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2jcc.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2qgjava.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2policy.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2jcc_license_cisuz.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2jcc_javax.jar
CLASSPATH=$CLASSPATH:/opt/IBM/db2/V8.1/java/db2jcc_license_cu.jar
export CLASSPATH

java -cp `ls -1 schemacrawler-*.jar`:$CLASSPATH schemacrawler.Main \
-command=maximum_schema \
-outputformat=text \
-g /application/shared/install/schemacrawler/schemacrawler.config.properties \
-connection=$1
-------

Now i ran into another problem :-)

--- my config --------------------------------------------
vk1xap04.host=127.0.0.1
vk1xap04.port=60020
vk1xap04.database=vk1xap04
vk1xap04.schemapattern=vk1xap04
vk1xap04.user=vk1xap04
vk1xap04.password=<removed>
vk1xap04.driver=com.ibm.db2.jcc.DB2Driver
vk1xap04.url=jdbc:db2://${host}:${port}/${database}
---------------------------------------------------------

- error output ----------------------------------------------

-- database product: DB2/SUN SQL08024
-- driver: com.ibm.db2.jcc.DB2Driver - IBM DB2 JDBC Universal Driver
Architecture 2.8.46
-- connection: jdbc:db2://127.0.0.1:60020/vk1xap04
-- schema pattern: vk1xap04
------------------------------------------------------------------------
AllProceduresAreCallable false
AllTablesAreSelectable false
CatalogSeparator .
Exception in thread "main" java.lang.NullPointerException
at
schemacrawler.tools.schematext.BaseSchemaTextForma tter.handle(BaseSchemaTextFormatter.java:160)
at
schemacrawler.crawl.SchemaCrawler.crawlDatabaseInf o(SchemaCrawler.java:186)
at schemacrawler.crawl.SchemaCrawler.crawl(SchemaCraw ler.java:131)
at
schemacrawler.tools.ToolsExecutor.execute(ToolsExe cutor.java:126)
at schemacrawler.Main.doMain(Main.java:124)
at schemacrawler.Main.main(Main.java:82)
--------------------------------------------------------------------------

I´m have no idea how to solve this ....

Best regards

Marc Schoechlin

----
Dec 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: sfsfsfsf | last post by:
SchemaCrawler is a new schema diff tool on Sourceforge. http://sourceforge.net/projects/schemacrawler It can display the schema in a text format (plain text, CSV, or HTML), designed for...
6
by: Rhino | last post by:
Is anyone aware of software - freeware, shareware or commercial - that could be used to compare two tables and highlight any differences between them? Ideally, such a tool wouldn't care about...
8
by: mjf | last post by:
I need to come up with a tool to compare the table definition and/or its data before and after some modification to the DDL or some tests (that change the data). Does DB2 come with such a tool, or...
3
by: Thyagu | last post by:
Hi, I'd like to reverse engineer the schema definitions in the SQL Server on a daily basis and store them in a version control system. Could anyone please let know if there are any tools to...
6
by: Trevor Best | last post by:
Is there a way to back up the structure of the database only? i.e. backup without the data. I sometimes need to backup a database in one location and compare the structure in another, can be a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.