• 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

Create a database programmatically?

 
Author
Posts: 160
11
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Once you've created a database in your native operating system, you can add tables and make other changes with JDBC. But is there a way to create the database itself (other than an in-memory database)? Thanks.
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With postgres, you have a command-line interface (on linux), and can call 'Runtime...' to create a new DB.
But perhaps using ...

will work too.
Did you try something like that?
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Barry,


with JDBC ... is there a way to create the database itself


That depends on the definition of database that your [O|R]DBMS is using. In my experience, working with Informix and Oracle, one does allow it (Informix) while the other does not. This is because Oracle equates a "database" with Informix's notion of an "instance", whereas Oracle's definition of a "schema" is parallel to Informix's idea of a database.
So, in conclusion, it depends on the DBMS you are using. Unfortunately I couldn't find that detail in your post, so I can't really answer your question, can I?
Good Luck,
Avi.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic