• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java code to create sqlite database

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any one for help ranchers

zishan
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Let nothing stop you! Not even this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic