We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
SQLite JDBC (Read 2506 times)
SQLite JDBC
Feb 26th, 2007, 9:54am
 
Edited:

this post has been moved to a more appropriate venue - SDN's java forum. new thread link

also--the problem discussed in the thread has been resolved.


i've been using the SQLite JDBC driver in order to load maps and filenames from an SQLite *.s3db file. locally, it works fine.

as soon as i upload it to my webserver (which is on my local network, controlled by me), it just blanks out and sits there.

Code:
java.lang.NoClassDefFoundError
at org.sqlite.Conn.<init>(Conn.java:11)
at org.sqlite.JDBC.connect(JDBC.java:38)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at MapPanel.grabTiles(MapPanel.java:40)
at MapPanel.setup(MapPanel.java:22)
at processing.core.PApplet.handleDisplay(PApplet.java:1281)
at processing.core.PGraphics.requestDisplay (PGraphics.java:564)
at processing.core.PApplet.run(PApplet.java:1450)
at java.lang.Thread.run(Unknown Source)


the particular chunk of code in question is this:

Code:
public void grabTiles()
{
try {
 String fileName = "curse.s3db";
 Class.forName("org.sqlite.JDBC");
 Connection conn = DriverManager.getConnection("jdbc:sqlite:"+fileName);
 Statement stmt = conn.createStatement();
 ResultSet rs = stmt.executeQuery("select * from tiles__map");

...



and the line in particular:
Code:
  Connection conn = DriverManager.getConnection("jdbc:sqlite:"+fileName);


note - "fileName" is "curse.s3db" .. i have also tried "./curse.s3db" and various http urls referencing the db file on the remote server or my local hard drive, depending on the test.

this even happens when i run the applet in an index.html file in my own local hard drive, in the same directory as everything else that should be necessary.

again.. locally, everything works like magic. as soon as i try to embed it, it breaks.

is there some parameter i need to pass to it in the HTML tag that i don't know about in order to tell it where to find everything else?

i realize i have been a busy bee asking lots of questions on the forum lately, and i appreciate everyone's help. i only have a couple more hurdles to get over regarding data sources before i can really dive headfirst into the mechanics of everything (my strongpoint).
Re: SQLite JDBC
Reply #1 - Feb 26th, 2007, 7:47pm
 
it dawned on me that this is not really a processing question. i will take it to some java forums.
Page Index Toggle Pages: 1