Java SQL Table Create createTable(String query)

Here you can find the source of createTable(String query)

Description

create Table

License

Open Source License

Declaration

public static void createTable(String query) 

Method Source Code


//package com.java2s;
/*/*from w  w w. j  a v  a 2  s  . c  o  m*/
 * The information in this document is subject to change without notice and 
 * does not represent a commitment by Headstrong Corporation. The software 
 * and/or databases described in this document are furnished under a license 
 * agreement and may be used or copied only in accordance with the terms of 
 * the agreement. 
 * 
 * Copyright ? 2008 Headstrong Corporation
 * All rights reserved.
 * 
 * $Id: HibernateUtil.java
 * $Revision: 
 * $Author: ViswanathP
 * $DateTime: Oct 29, 2009 
 */

import java.sql.Connection;

import java.sql.Statement;

public class Main {
    static Connection conn;
    static Statement stmt;

    public static void createTable(String query) {
        try {
            stmt = conn.createStatement();
            stmt.executeUpdate(query);
        } catch (Exception e) {
            System.err.println("Got an exception! ");
            e.printStackTrace();
            System.exit(0);
        }
    }
}

Related

  1. createTable(Connection conn, String createTableStatement)
  2. createTable(Connection conn, String inputSqlType, String sortOrder)
  3. createTable(Connection conn, String sqlText)
  4. createTable(Connection connection)
  5. createTable(Connection dbConn, String tableName, String columnSpec)
  6. createTableAndLoadData(Statement stmt, String tableName)
  7. createTestTable(Connection conn)
  8. createTestTables(Statement sStatement)