Java SQL Table createSourceTable(Connection con)

Here you can find the source of createSourceTable(Connection con)

Description

Creates the source table for testing the MatchPool.

License

Open Source License

Declaration

public static void createSourceTable(Connection con)
        throws SQLException 

Method Source Code

//package com.java2s;
/*/*ww  w.j  a  v a 2  s. com*/
 * Copyright (c) 2008, SQL Power Group Inc.
 *
 * This file is part of DQguru
 *
 * DQguru is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * DQguru is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 */

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class Main {
    /**
     * Creates the source table for testing the MatchPool. See
     * ({@link MatchPoolTest})
     * This table is only required if we want to test against a database.
     */
    public static void createSourceTable(Connection con)
            throws SQLException {
        Statement stmt = con.createStatement();
        stmt.executeUpdate("CREATE TABLE pl.source_table ("
                + "\n PK1 varchar(50) not null," + "\n FOO varchar(10),"
                + "\n BAR varchar(10),"
                + "\n CONSTRAINT SOURCE_TABLE_PK PRIMARY KEY (PK1)" + "\n)");
        stmt.close();
    }
}

Related

  1. count(Connection conn, String table)
  2. countTables(Connection connection)
  3. createBagValuesTables(Connection con)
  4. createFreqTable()
  5. createHSQLTables(LineNumberReader reader, Statement statement)
  6. createTable(Connection dbCon, String tableName, String fields)
  7. createTable(Statement statement, String spaceName, String minSeeders, String capacity, String replicationCount)
  8. createTable(String createTblSql, Connection conn)
  9. createTableAndInsertData(Connection c)