Package com.healthmarketscience.sqlbuilder

Examples of com.healthmarketscience.sqlbuilder.CreateTableQuery


  public void createSchema() throws IOException {
    if(!schemaExists()) {

      log.info("creating schema: " + sqlTable.getAbsoluteName());

      CreateTableQuery query = new CreateTableQuery(sqlTable, true);

      setColumnConstraintForQuery(query, primaryColumn);
      for(Column column : mapping.getFields().values()) {
        setColumnConstraintForQuery(query, column);
      }

      PreparedStatement statement = null;
      try {
        statement = connection.prepareStatement(query.validate().toString());
        statement.executeUpdate();
      } catch (SQLException ex) {
        throw new IOException(ex);
      } finally {
        SqlUtils.close(statement);
View Full Code Here

TOP

Related Classes of com.healthmarketscience.sqlbuilder.CreateTableQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.