简体   繁体   中英

eclipse java how to had sqlite-jdbc-(VERSION).jar into my project and use it

my scenario : on my work on android sqlite i noticed I need to build the sql data base outside the app in java

therfor as one who knows nothing about how to install ***.jar files i google it all the example for how to install it weren't relevant for my situation where my platform is eclipse in windows 7 .

i would someone to instract me how to do the fallowing

  • i have downloaded sqlitejdbc-v056 and now i wish to append it to my project
  • how can I open a new data base , can i do :

      Class.forName("sqlitejdbc-v056"); Connection conn = DriverManager.getConnection("jdbc:sqlite:C:/Users/STERN/workspace/Test1/src/notexistyet.db"); 

    where notexistyet doesnt exist and by writing the last it will b created

thank u.

As far as i understand, you need to add sqlitejdbc-v056.jar to your Libraries (build path) so that you can use the jar file.

Right click on your Eclipse Project->Build Path->Configure Build Path...->Add External Jar (under libraries)

Browse to the JAR file and add it.

Then this will work:

    Class.forName("org.sqlite.JDBC");
    Connection conn = DriverManager.getConnection("jdbc:sqlite:test.db");

Source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM