db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Allen <kb9...@gmail.com>
Subject Activity 3: Run a JDBC program using the embedded driver
Date Thu, 17 May 2012 03:38:57 GMT
First off for a unix/linux type system I need > java -cp . WwdEmbedded
  or else I get
Error: Could not find or load main class WwdEmbedded
Now for > java -cp . WwdEmbedded I get

ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver

    >>> Please check your CLASSPATH variable   <<<

 . . . exception thrown:

---SQLException Caught---

SQLState:   08001
Severity: 0
Message:  No suitable driver found for jdbc:derby:jdbcDemoDB;create=true
java.sql.SQLException: No suitable driver found for
jdbc:derby:jdbcDemoDB;create=true
        at java.sql.DriverManager.getConnection(DriverManager.java:604)
        at java.sql.DriverManager.getConnection(DriverManager.java:243)
        at WwdEmbedded.main(WwdEmbedded.java:72)
Getting Started With Derby JDBC program ending.

And yes I did export CLASSPATH=$DERBY_HOME/lib/derby.jar:.

I ran ~/NetBeansProjects/JDBC_Learning/DERBYTUTOR$ sysinfo

------------------ Java Information ------------------
Java Version:    1.7.0_03
Java Vendor:     Oracle Corporation
Java home:       /home/kb9agt/jdk1.7/jre
Java classpath:
/home/kb9agt/jdk1.7/db/lib/derby.jar:/home/kb9agt/jdk1.7/db/lib/derbynet.jar:/home/kb9agt/jdk1.7/db/lib/derbytools.jar:/home/kb9agt/jdk1.7/db/lib/derbyclient.jar:/home/kb9agt/jdk1.7/db/lib/derby.jar:.
OS name:         Linux
OS architecture: i386
OS version:      2.6.27-1-mepis-smp
Java user name:  kb9agt
Java user home:  /home/kb9agt
Java user dir:   /home/kb9agt/NetBeansProjects/JDBC_Learning/DERBYTUTOR
java.specification.name: Java Platform API Specification
java.specification.version: 1.7
java.runtime.version: 1.7.0_03-b04
--------- Derby Information --------
JRE - JDBC: Java SE 6 - JDBC 4.0
[/home/kb9agt/jdk1.7/db/lib/derby.jar] 10.8.1.2 - (1095077)
[/home/kb9agt/jdk1.7/db/lib/derbytools.jar] 10.8.1.2 - (1095077)
[/home/kb9agt/jdk1.7/db/lib/derbynet.jar] 10.8.1.2 - (1095077)
[/home/kb9agt/jdk1.7/db/lib/derbyclient.jar] 10.8.1.2 - (1095077)
------------------------------------------------------
----------------- Locale Information -----------------
Current Locale :  [English/United States [en_US]]
Found support for locale: [cs]
         version: 10.8.1.2 - (1095077)
Found support for locale: [de_DE]
         version: 10.8.1.2 - (1095077)
Found support for locale: [es]
         version: 10.8.1.2 - (1095077)
Found support for locale: [fr]
         version: 10.8.1.2 - (1095077)
Found support for locale: [hu]
         version: 10.8.1.2 - (1095077)
Found support for locale: [it]
         version: 10.8.1.2 - (1095077)
Found support for locale: [ja_JP]
         version: 10.8.1.2 - (1095077)
Found support for locale: [ko_KR]
         version: 10.8.1.2 - (1095077)
Found support for locale: [pl]
         version: 10.8.1.2 - (1095077)
Found support for locale: [pt_BR]
         version: 10.8.1.2 - (1095077)
Found support for locale: [ru]
         version: 10.8.1.2 - (1095077)
Found support for locale: [zh_CN]
         version: 10.8.1.2 - (1095077)
Found support for locale: [zh_TW]
         version: 10.8.1.2 - (1095077)
------------------------------------------------------

and echo $CLASSPATH
/home/kb9agt/jdk1.7/db/lib/derby.jar:.
I see A : separated list of directories

I think I need
java -cp $CLASSPATH WwdEmbedded
Yep. Did the trick. Please update the tutorial as soon as you can.
Thanks!
Douglas

Mime
View raw message