Ingimar Erlingsson wrote:
Hello!
Thank you for derby!
I have a question, did follow the example in
'db-derby-10.1.2.1-bin\demo\simple\simpleapp.java'
in the demo only one table is created.
My database, which I have now in mysql has 8 tables and relationships
between them.
I would like to create my database from within my application:
And my question is: must I do the following for all 5 tables ->
s.execute("CREATE TABLE AP .......");
and for all their relationsships or can I put all these in some
property or txt file and fetch them from there ?
And the same for all my relationships. And package that property-file
or txt file with my application jar ?
Or can I create a procedure in the database that is called which
creates all my tables and their realtionships.
Or should I use hibernate ( never tested hibernate though) and include
som xml file ?
regards, i
Hi,
You can write all your SQL statements in a sql file and just pass that
sql file name as a string in your application. I think your application
is in java, then you can pass the file name like this
org.apache.derby.tools.ij.main(new String[ ] {"-fr", "schema.sql"});
Thanks
Manjula