db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: Derby with creme
Date Thu, 25 Aug 2011 07:55:57 GMT
maxf11 <m.fecchio@mbm.it> writes:

> Hi all!
>
> I'm developing a Java application for a PDA WM 6.5.
> I'm trying to use Derby DB with JVM CreMe 4.12 (JDK 1.3.1).
> I've downloaded Derby 10.2.2 version, and I've tried to run the simpleApp
> application.
> I've created a directory \derby on the filesystem, with 3 files (derby.jar,
> SimpleApp.class, simpleApp.lnk).
> simpleApp.lnk contains this command row:
>
> "\windows\CrEme\bin\CrEme.exe" -classpath \derby\;\derby\derby.jar -Of
> SimpleApp
>
> I get this error:
>
> NSIcom Ltd., CrEme(tm) Evaluation Version
> CrE-ME J2ME(tm)
> CrE-ME V4.12.26 B160.081109 8-November-2009
>   MemoryLimit=30080Kb
> EBCI(TM) Interpreter V1.00,
> Copyright 1998-2002 by Bytecodes, Inc.
> SimpleApp starting in embedded mode.
> Startup failed due to missing functionality for
> org.apache.derby.iapi.services.stream.InfoStreams. Please ensure your
> classpath includes the correct Derby software.
> ERROR XBM02: Startup failed due to missing functionality for
> org.apache.derby.iapi.services.stream.InfoStreams. Please ensure your
> classpath includes the correct Derby software.
> 	at org.apache.derby.iapi.error.StandardException.newException()
> 	at org.apache.derby.iapi.services.monitor.Monitor.missingImplementation()
> 	at org.apache.derby.impl.services.monitor.TopService.bootModule()
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule()
> 	at org.apache.derby.iapi.services.monitor.Monitor.startSystemModule()
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState()
> 	at org.apache.derby.impl.services.monitor.FileMonitor.<init>()
> 	at org.apache.derby.iapi.services.monitor.Monitor.startMonitor()
> 	at org.apache.derby.iapi.jdbc.JDBCBoot.boot()
> 	at org.apache.derby.jdbc.EmbeddedDriver.boot()
> 	at org.apache.derby.jdbc.EmbeddedDriver.<clinit>()
> 	at java.lang.Class.forName()
> 	at SimpleApp.go()
> 	at SimpleApp.main()
>
> Loaded the appropriate driver.
> exception thrown:
> java.sql.SQLException: No suitable driver
> SimpleApp finished

Hi Max,

It looks like your application is attempting to load the Derby driver by
doing Class.forName("org.apache.derby.jdbc.EmbeddedDriver"). Is that
right?

On J2ME environments java.sql.Driver typically isn't available, so
instead of using Class.forName() + DriverManager.getConnection() to boot
Derby and obtain a connection, you'd have to do something like this:

import org.apache.derby.jdbc.EmbeddedSimpleDataSource

(...)

EmbeddedSimpleDataSource ds = new EmbeddedSimpleDataSource();
ds.setDatabaseName("mydb");
ds.setCreateDatabase("create");

Connection c = ds.getConnection();

I haven't tried Derby on CreMe myself, so I don't know if it works on
that platform.

Hope this helps,

-- 
Knut Anders

Mime
View raw message