Here you can find the source of executeCall(Connection connection, String command, String schemaName, String tableName, int paramLength)
Parameter | Description |
---|---|
connection | Database connection |
command | Command to execute |
schemaName | Name of selected schema |
tableName | Name of selected table |
paramLength | Length of short params needed for the command |
Parameter | Description |
---|---|
SQLException | an exception |
private static void executeCall(Connection connection, String command, String schemaName, String tableName, int paramLength) throws SQLException
//package com.java2s; /*/*from w w w. j a v a 2 s .c o m*/ * Artifactory is a binaries repository manager. * Copyright (C) 2012 JFrog Ltd. * * Artifactory 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, either version 3 of the License, or * (at your option) any later version. * * Artifactory 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. * * You should have received a copy of the GNU Lesser General Public License * along with Artifactory. If not, see <http://www.gnu.org/licenses/>. */ import java.sql.CallableStatement; import java.sql.Connection; import java.sql.SQLException; public class Main { /** * Executes the given call (does not commit) * * @param connection Database connection * @param command Command to execute * @param schemaName Name of selected schema * @param tableName Name of selected table * @param paramLength Length of short params needed for the command * @throws SQLException */ private static void executeCall(Connection connection, String command, String schemaName, String tableName, int paramLength) throws SQLException { CallableStatement cs = connection.prepareCall(command); cs.setString(1, schemaName); cs.setString(2, tableName); paramLength += 3; for (int i = 3; i < paramLength; i++) { cs.setShort(i, (short) 1); } cs.execute(); } }