aspose file tools
The moose likes JDBC and Relational Databases and the fly likes java code to create sqlite database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java code to create sqlite database" Watch "java code to create sqlite database" New topic
Author

java code to create sqlite database

zishan khan
Greenhorn

Joined: Jan 28, 2011
Posts: 16
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

Joined: Jan 28, 2011
Posts: 16
any one for help ranchers

zishan
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31439
    
184

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.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

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

Joined: Jan 28, 2011
Posts: 16
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java code to create sqlite database