Here you can find the source of createBagValuesTables(Connection con)
Parameter | Description |
---|---|
con | the Connection to use |
Parameter | Description |
---|---|
SQLException | if there is a database problem |
public static void createBagValuesTables(Connection con) throws SQLException
//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); } }