0

I'm working with an Oracle database and I'm trying to create a system in Java that will read the database's existing schema and triggers; then create an in-memory local database that we can use for testing purposes. I know that I can get the schema information from the connection object with JDBC, but I'm not sure how to get the trigger information.

I know that I can build a database with hibernate by filling out the tables in the cnf.xml file, but I want to make it an automatic process because the database will most likely change over time.

Are there any tools or plugins that anyone knows of that does this already so I don't have to reinvent the wheel?

Edit: Not sure why this is being marked as duplicate. Clearly I asked for more than just getting triggers of an existing database.

  • You can use a select query to see what tables are available: [link](http://stackoverflow.com/questions/2247310/how-do-i-list-all-tables-in-a-schema-in-oracle-sql). Then you can get all the table colums using `DESCRIBE table_name` – Luud van Keulen Feb 14 '17 at 21:00
  • Thank-you! Is there a similar way to get all the triggers of a database? – I_Catch_Nothing Feb 14 '17 at 21:05
  • [link](http://stackoverflow.com/questions/4896621/oracle-query-to-find-all-the-triggers-belonging-to-the-tables) – Luud van Keulen Feb 14 '17 at 21:06
  • lol. I guess I should just search stackoverflow before I ask anything. Thanks again! – I_Catch_Nothing Feb 14 '17 at 21:09
  • You might want to look at schema management tools like [Liquibase](http://liquibase.org/) to manage your database definition. With some care this can generate the schema for Oracle and e.g. HSQLDB from the same (XML) source. No need to re-invent the wheel. Using a tool like that is indispensable in my opinion anyway. –  Feb 14 '17 at 22:40
  • Thanks! I'll take a look into this. – I_Catch_Nothing Feb 15 '17 at 22:16

0 Answers0