Java SQL Execute executeUnRegister(String schemaName, String tableName, String columnName, Connection con)

Here you can find the source of executeUnRegister(String schemaName, String tableName, String columnName, Connection con)

Description

execute Un Register

License

Open Source License

Declaration

public static void executeUnRegister(String schemaName, String tableName, String columnName, Connection con)
            throws SQLException 

Method Source Code

//package com.java2s;
/*//  ww  w . j  a v  a  2s.  c  o m
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *    (C) 2011-2012, Open Source Geospatial Foundation (OSGeo)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library 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
 *    Lesser General Public License for more details.
 *
 */

import java.sql.CallableStatement;

import java.sql.Connection;

import java.sql.SQLException;

import java.sql.Types;

public class Main {
    public static void executeUnRegister(String schemaName, String tableName, String columnName, Connection con)
            throws SQLException {

        String stmt = "call db2gse.ST_unregister_spatial_column(?,?,?,?,?)";

        String s = "{" + stmt + "}";
        CallableStatement ps = con.prepareCall(s);
        ps.setString(1, quote(schemaName));
        ps.setString(2, quote(tableName));
        ps.setString(3, quote(columnName));
        ps.registerOutParameter(4, Types.INTEGER);
        ps.registerOutParameter(5, Types.CHAR);
        ps.executeUpdate();
        //DB2TestSetup.LOGGER.log(Level.INFO,ps.getInt(4) + "|" + ps.getString(5));

    }

    private static String quote(String s) {
        return "\"" + s + "\"";
    }
}

Related

  1. executeSqlFromSql(Connection connection, String sql, String name)
  2. executeStatement(Connection con, String sql)
  3. executeStatement(Connection conn, String command)
  4. executeStatement(final String databaseName, final String statement)
  5. executeStatements(final Connection conn, final List statements)