NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

sqlite netbeans module

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Allan.Cochrane



Joined: 24 Feb 2009
Posts: 2

PostPosted: Tue Feb 24, 2009 10:35 pm    Post subject: sqlite netbeans module Reply with quote

Hi,

I'm using the Netbeans module for sqlite3 from: http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=16018 and this does indeed allow me to create and read databases in the Netbeans 'Services' tab.

My issues begin when I try to use this module in a Netbeans platform-based application. A standalone Java app using the library that the Netbeans plugin wraps works just fine but my app fails to find the driver:

java.lang.ClassNotFoundException: org.sqlite.JDBC

Code:


        String url = "jdbc:sqlite://c:\\blah.db";
        try {
            Class.forName("org.sqlite.JDBC");
            Connection con = DriverManager.getConnection(url);
            String query = "select * from CAR";
            Statement stmt = con.createStatement();
            con = DriverManager.getConnection(url);
            ResultSet rs = stmt.executeQuery(query);
            while (rs.next()) {
                Logger.getLogger(output1TopComponent.class.getName()).log(Level.INFO, rs.getString(1));
            }
            rs.close();
            stmt.close();
        } catch (Exception e) {
            e.printStackTrace();
        }



I blieve I have exported the library API and added it as a module dependency, unfortunately I don't know how to add it as a straight library dependency as one can in a simple Java application.

Where should I start to look?

Thanks,

Allan
Back to top
zach2825



Joined: 17 Jun 2010
Posts: 2

PostPosted: Thu Jun 17, 2010 2:40 am    Post subject: java.lang.ClassNotFoundException: org.sqlite.JDBC Reply with quote

first download the sqlite jdbc driver
from http://www.zentus.com/sqlitejdbc/

in the netbeans ide:
in the tools menu click plugins

select downloaded
Click the button add plugin

navagate to the downloaded jdbc driver
install the driver

than after that is done close the plugin menu

than in a new project click the "sources folder" in the "projects tab" on the left side of net beans(default settings)

select the libraries catagory
then click the add library button and add "SQLite JDBC Driver" that should be there if not than something went wrong with the install in one of the earlier steps...


This is the most basic way i could get this to work. GOOD LUCK let me know how it goes
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo