Before I write one, is there a Java API for manipulating a database. Like an object orientated wrapper around java.sql.DatabaseMetaData
, with support for things like Schema.createTable(name, columns)
?
Obviously correct SQL statements should be executed in the background based on the DB in use.
I'm specifically interested in an API for performing DDL statements.
DDL is a set of SQL commands used to create, modify, and delete database structures but not data. These commands are normally not used by a general user, who should be accessing the database via an application.
sql Description. Provides the API for accessing and processing data stored in a data source (usually a relational database) using the JavaTM programming language. This API includes a framework whereby different drivers can be installed dynamically to access different data sources.
Java Language Extension is a feature of SQL Server used for executing external Java code. The relational data can be used in the external Java code using the extensibility framework. The Java Language Extension is part of SQL Server Language Extensions.
Many object-relational mapping frameworks come with tools to generate domain model classes out of an existing schema, or create (or even update) a schema to match the domain model classes.
In particular, hibernate can do this, see
http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#toolsetguide-s1
DdlUtils from Apache does this https://db.apache.org/ddlutils/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With