• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java code to create sqlite database

 
zishan khan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranchers,

would you please let me know the java code to create sqlite database, searched google but with no luck.
I know how to create it manually, but dont know how to create it through java code.
once i created the database, i know the rest of the stuff.

thank you

zishan
 
zishan khan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any one for help ranchers

zishan
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zishan,
You could always use Runtime.exec() and use the command line. Or do you only know how to use a GUI to create.

Also please don't bump posts. It could take up to 24 hours for someone to see it due to timezones.
 
Joachim Rohde
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at SQLJet.

SQLJet is a software library that provides API that enables Java application to read and modify SQLite databases.


You can find a tutorial here
 
zishan khan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks guys,
i was facing problems with sqlite database, there is no javacode I found to create the .db sqlite database, also tried batch file but then i was struggling for the location of the bacth file when the jar runs, also there was maintenance problem.

@echo off
echo Hello this is zishan's batch file

> "personsdata.sql" ECHO create table personsdata (person_fistname varchar(20),person_lastname varchar(20),person_telephone BIGINT,address1 varchar(100),address2 varchar(100),county varchar(50),postcode varchar(20),notes varchar(1000),image varchar(200));

sqlite3 D:/contactBook.db < personsdata.sql

well ...to sum up I droped the idea of using sqlite with my app instead i used embedded derby which is perofming excellent.

thanks for your sugestions

regrds
zishan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic