Strange issue with sqlite-jdbc-3.6.6 on OS X

56 views
Skip to first unread message

Jon Cooper

unread,
Dec 2, 2008, 11:26:20 AM12/2/08
to Xerial
Hi there.

I'm attempting to use sqlite-jdbc-3.6.6 on OS X 10.5. I'm running the
standard Apple Java VM 1.5.0_16.

Any attempt to use the JDBC driver blows up looking for
java.sql.NClob, which I gather was added in Java 1.6. Do I need to
have Java 1.6?

Example below:

ultramarine:db jdc$ groovysh
Groovy Shell (1.5.7, JVM: 1.5.0_16)
Type 'help' or '\h' for help.
------------------------------------------------------------------------------------
groovy:000> import java.sql.*
groovy:000> Class.forName("org.sqlite.JDBC")
===> class org.sqlite.JDBC
groovy:000> dbConn = DriverManager.getConnection
("jdbc:sqlite:newdb.sqlite")
ERROR java.lang.NoClassDefFoundError: java/sql/NClob

The truly annoying thing is that I don't need an NCLOB. I just need a
VARCHAR! (Yes, I know about SQLite3 column affinities, etc.)

Any help would be much appreciated.

Jon

Taro L. Saito

unread,
Dec 2, 2008, 8:20:06 PM12/2/08
to xer...@googlegroups.com
Hi Jon,

I used JDK 1.6 to build the version 3.6.6, and that might be the cause
of your problem.

I compiled SQLite JDBC version 3.6.6.2-1 using JDK 1.5.
http://www.xerial.org/maven/repository/artifact/org/xerial/sqlite-jdbc/3.6.6.2-1/

I haven't used groovy, so I installed the groovy version 1.5.7, put
sqlite-jdbc-3.6.6.2-1.jar into
$HOME/.groovy/lib folder, and then did the following steps:

groovy:000> import java.sql.*
groovy:000> Class.forName("org.sqlite.JDBC")
===> class org.sqlite.JDBC
groovy:000> dbConn = DriverManager.getConnection("jdbc:sqlite:sample.db")
===> org.sqlite.Conn@dc6592
groovy:000> dbConn.createStatement().executeUpdate("create table a (p1, p2)")
===> 0
groovy:000> dbConn.createStatement().executeUpdate("insert into a
values(1, 2)")
===> 1
groovy:000> dbConn.createStatement().executeUpdate("insert into a values(1, 3)")
===> 1
groovy:000> dbConn.createStatement().executeQuery("select * from a")
===> org.sqlite.RS@c2b8eb
grooby:000>quit

leo@iris:~/tmp/jdbc> sqlite3 sample.db "select * from a"
1|2
1|3

I hope it will work successfully on your Mac OS X.

# And I also hope Java 6 will be the standard of Mac OS X...
--
Taro L. Saito
<l...@cb.k.u-tokyo.ac.jp>
University of Tokyo
Tel. +81-47-136-4065 (64065)

Taro L. Saito

unread,
Dec 2, 2008, 8:22:56 PM12/2/08
to Xerial
I forgot to mention my OS environment; I used Mac OS X 10.4.

> Hi Jon,
>
> I used JDK 1.6 to build the version 3.6.6, and that might be the cause
> of your problem.
>
> I compiled SQLite JDBC version 3.6.6.2-1 using JDK 1.5.http://www.xerial.org/maven/repository/artifact/org/xerial/sqlite-jdb...

Jon Cooper

unread,
Dec 22, 2008, 11:51:21 AM12/22/08
to xer...@googlegroups.com
Thanks!
--
Jon Cooper (jon.c...@gmail.com)
Reply all
Reply to author
Forward
0 new messages