Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java API for SQL Data Definition Language [closed]

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.

like image 343
Jesse Avatar asked Jun 22 '11 16:06

Jesse


People also ask

Is DDL same as SQL?

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.

Which package in Java provides API for accessing and processing data in relational database?

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.

Is Java a SQL language?

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.


2 Answers

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

like image 170
meriton Avatar answered Oct 04 '22 07:10

meriton


DdlUtils from Apache does this https://db.apache.org/ddlutils/

like image 42
ykaganovich Avatar answered Oct 04 '22 05:10

ykaganovich