Archived

This topic is now archived and is closed to further replies.

Rednevac

[java] create databse

Recommended Posts

Hi all, This does not really pertain to game development but since there are a lot of good developers here I come here anyway. Is there a way and if so, how do I create a database in Java. Typically I would have to use the DBMS to do this, but ADOX and DAO lets me create a database through my code. Does JDBC have the same functionality? I have search through Sun''s documentation but all the examples use an existing database. This of course does me no good as my app needs to create one. Thanks in advance Joe

Share this post


Link to post
Share on other sites
JDBC passes calls directly, so:

Statement ps = con.prepareStatement( "create table my table( blah blah )" );
ps.executeUpdate();


I''d recommend doing this stuff in your SQL interface though, since you don''t (and shouldn''t) do it regularly.

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
Community Service Announcement: Read How to ask questions the smart way before posting!

Share this post


Link to post
Share on other sites