public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { return cstmt.executeUpdate(sql, columnIndexes); }
public int executeUpdate(String sql) throws SQLException { return cstmt.executeUpdate(sql); }
public int executeUpdate() throws SQLException { return cstmt.executeUpdate(); }
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { return cstmt.executeUpdate(sql, autoGeneratedKeys); }
public int executeUpdate(String sql, String[] columnNames) throws SQLException { return cstmt.executeUpdate(sql, columnNames); }
public int executeUpdate(String _sql) throws SQLException { long t1 = System.currentTimeMillis(); int result = cstmt.executeUpdate(_sql); long t2 = System.currentTimeMillis(); // determine the type of query String sqlL = _sql.toLowerCase().trim(); if (sqlL.startsWith("insert")) { addQuery(Type.insert, _sql, t2 - t1); } else if (sqlL.startsWith("update")) { addQuery(Type.update, _sql, t2 - t1); } else if (sqlL.startsWith("delete")) { addQuery(Type.delete, _sql, t2 - t1); } else { addQuery(Type.select, _sql, t2 - t1); } return result; } }
callableStatement.executeUpdate();
public int executeUpdate() throws SQLException { long t1 = System.currentTimeMillis(); int result = cstmt.executeUpdate(); long t2 = System.currentTimeMillis(); switch (type) { case select: addQuery(Type.select, sql, t2 - t1); break; case update: addQuery(Type.update, sql, t2 - t1); break; case insert: addQuery(Type.insert, sql, t2 - t1); break; case delete: addQuery(Type.delete, sql, t2 - t1); break; } return result; }
/** * Execute the statement in normal non batch mode. */ public int executeUpdate() throws SQLException { // check to see if the execution has been overridden // only works in non-batch mode if (callableSql.executeOverride(cstmt)) { return -1; // // been overridden so just return the rowCount // rowCount = callableSql.getRowCount(); // return rowCount; } rowCount = cstmt.executeUpdate(); // only read in non-batch mode readOutParams(); return rowCount; }
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)); }
rs=cs.executeQuery(); }else{ cs.executeUpdate(); rs=(ResultSet)cs.getObject(oracleCursorIndex);
public static void executeRegister( String schemaName, String tableName, String columnName, String srsName, Connection con) throws SQLException { String stmt = "call db2gse.ST_register_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.setString(4, srsName); ps.registerOutParameter(5, Types.INTEGER); ps.registerOutParameter(6, Types.CHAR); ps.executeUpdate(); // DB2TestSetup.LOGGER.log(Level.INFO,ps.getInt(5) + "|" + ps.getString(6)); }
public static List<Field> procedureColumnsQuery(String sql,Map<String, Object> pmap,Connection conn){ StatementWrapper wrapper=buildProcedureCallableStatement(sql, pmap, conn); CallableStatement cs=wrapper.getCallableStatement(); int oracleCursorIndex=wrapper.getOracleCursorIndex(); ResultSet rs=null; try { if(oracleCursorIndex==-1){ rs=cs.executeQuery(); }else{ cs.executeUpdate(); rs=(ResultSet)cs.getObject(oracleCursorIndex); } ResultSetMetaData metadata=rs.getMetaData(); int columnCount=metadata.getColumnCount(); List<Field> fields=new ArrayList<Field>(); for(int i=1;i<=columnCount;i++){ String columnName=metadata.getColumnLabel(i); fields.add(new Field(columnName)); } return fields; } catch (SQLException e) { throw new ReportException(e); }finally{ JdbcUtils.closeResultSet(rs); JdbcUtils.closeStatement(cs); JdbcUtils.closeConnection(conn); } }
public static void executeRegisterAndCalculateExtent( String schemaName, String tableName, String columnName, String srsName, Connection con) throws SQLException { try { String stmt = "call db2gse.ST_register_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.setString(4, srsName); ps.setInt(5, 1); ps.registerOutParameter(6, Types.INTEGER); ps.registerOutParameter(7, Types.CHAR); ps.executeUpdate(); // DB2TestSetup.LOGGER.log(Level.INFO,ps.getInt(5) + "|" + // ps.getString(6)); } catch (SQLException ex) { // // may happen for spatial extender versions < 10 // fall back registering without extent calculation executeRegisterAndCalculateExtent(schemaName, tableName, columnName, srsName, con); } }
/** * @see java.sql.Statement#executeUpdate(java.lang.String) */ public int executeUpdate(String sql) throws SQLException { return original.executeUpdate(sql); }
/** * @see java.sql.Statement#executeUpdate(java.lang.String, * java.lang.String[]) */ public int executeUpdate(String sql, String[] columnNames) throws SQLException { return original.executeUpdate(sql, columnNames); }
public int executeUpdate() throws SQLException { preInvoke(); try { return cs.executeUpdate(); } catch (SQLException e) { catchInvoke(e); } return 0; }
@Override public int executeUpdate() throws SQLException { try { return wrappedStatement.executeUpdate(); } catch ( SQLException se ) { connection.getHandler().setFlushOnly( se ); throw se; } }
public int executeUpdate() throws SQLException { Profiler profiler = _profilerPoint.start(); try { return _callableStatement.executeUpdate(); } finally { profiler.finish(); } }
public int executeUpdate(String sql, String[] columnNames) throws SQLException { Profiler profiler = _profilerPoint.start(); try { return _callableStatement.executeUpdate(sql, columnNames); } finally { profiler.finish(); } }