This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Creating Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Creating Database" Watch "Creating Database" New topic
Author

Creating Database

Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 289

Hi i am using Mysql database.

I need to create the database from my java application.

is their any way?

Please give some inputs how i can do that?


-Chiru
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38040
    
  22
A trip to the Java Tutorials is called for
Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 289

Sorry if i am not asking question properly.

i want to create the database, like what we use the query in Mysql as "Create data base XXXXX" like that is their any way to run this query with out having any database in Mysql.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38040
    
  22
As far as I know you can pass "create database if not exists chirus_database" as a statement with the java.sql.Statement#execute or java.sql.Statement#executeUpdate methods.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38040
    
  22
You might need to specify your Statement as updatable type when you create it from the Connection.
Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 289

Thank you this is what i am expecting..
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38040
    
  22
Originally posted by Chiru Raj:
Thank you this is what i am expecting..
You're welcome
 
Don't get me started about those stupid light bulbs.
 
subject: Creating Database
 
Similar Threads
Sharing data between web app's
menu creation
share data
designing login page
No proxy with session.load() instead it does a database hit - Why?