Java SQL Table createBagValuesTables(Connection con)

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

Description

Create the table 'bagvalues' containing the values of the key field objects contained in a bag and an extra values

License

GNU General Public License

Parameter

Parameter Description
con the Connection to use

Exception

Parameter Description
SQLException if there is a database problem

Declaration

public static void createBagValuesTables(Connection con) throws SQLException 

Method Source Code


//package com.java2s;
/*/*from w w w  .  j ava2s. c o  m*/
 * Copyright (C) 2002-2014 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import java.sql.Connection;

import java.sql.SQLException;

public class Main {
    /**
     * Create the table 'bagvalues' containing the values of the key field objects
     * contained in a bag and an extra values
     * @param con the Connection to use
     * @throws SQLException if there is a database problem
     */
    public static void createBagValuesTables(Connection con) throws SQLException {
        String sqlTable = "CREATE TABLE bagvalues (savedbagid integer, value text, extra text)";
        String sqlIndex = "CREATE UNIQUE INDEX bagvalues_index1 ON bagvalues " + "(savedbagid, value, extra)";
        con.createStatement().execute(sqlTable);
        con.createStatement().execute(sqlIndex);
    }
}

Related

  1. clearTables(Connection connection)
  2. columnExist(String table, String column, Connection con)
  3. constructObject(Class theClass, Connection db, int objectId, String tableName, String uniqueField)
  4. count(Connection conn, String table)
  5. countTables(Connection connection)
  6. createFreqTable()
  7. createHSQLTables(LineNumberReader reader, Statement statement)
  8. createSourceTable(Connection con)
  9. createTable(Connection dbCon, String tableName, String fields)