Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to create/drop a database from Java (via JDBC)?

Re: How to create/drop a database from Java (via JDBC)?

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Fri, 20 Feb 2004 03:02:38 GMT
Message-ID: <iNeZb.18264$4o.36853@attbi_s52>

"Steffen Siebert" <news_at_SteffenSiebert.de> wrote in message news:ubrnu1vpi.fsf_at_SteffenSiebert.de...
> >>>>> "D" == DJ <nospamplease_at_goaway.com> writes:
>
> D> hmm yeah - didnt think hard enough really, can java fork out to
> D> a shell and run OS commands?
>
> Yes of course. But I would prefer a native java solution, which is
> likely to exist since oracle's dbca is written in java :)
>
> D> But it needs to be asked 'why'
>
> Because our java soft needs to be installed on several platforms with
> several database systems. So we wrote a java program which creates
> the database for our application on MS-SQL, Postgres and SAPDB. And
> now we also need oracle support.
>
> (Is 'why' really a question a programmer is allowed to ask? ;)
>
> Ciao,
> Steffen
>

Yes, one should ask why all the time. Not to be a pain but to give the customer a better product or result. Often the customer thinks they want one thing and they really mean another. Often by asking why, what problem are you trying to solve you will learn a lot about the customer's problem and be able to give them a better solution than the solution they came up with. The customer should be able to articulate what their problem is and hence you could come up solution to the problem.

Like in your case. Why do you want to create a database? You have indicated that you need your application to connect to an Oracle database. I am going to make a few guesses here (since we can't talk back in forth in real time.). I suspect that you do not need to create an Oracle database. In MS SqlServer do you install the RDBMS binaries, etc. I suspect that you do not, you assume that the MS SqlServer instance is already up and running. That (in MS SQL Server parlance) you connect to it and create a database.

To do the same thing in Oracle you would create a schema and put your stuff in there. In SQL Server domain you have an instance that consists of databases. In Oracle a similar thing would be an Oracle instance and multiple schemas. (create a user and define what their default and temp tablespace is)

Creating a database in Oracle is akin to installing the whole MS SQL Server instance. Not the same thing.
You really want a script to create your schema and populate your tables etc.

Jim Received on Thu Feb 19 2004 - 21:02:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US