private static CommandInterface closeAndSetNull(CommandInterface command) { if (command != null) { command.close(); } return null; }
/** * Called when the result set is closed. * * @param command the command * @param closeCommand whether to close the command */ void onLazyResultSetClose(CommandInterface command, boolean closeCommand) { setExecutingStatement(null); command.stop(); if (closeCommand) { command.close(); } }
/** * Closes this statement. * All result sets that where created by this statement * become invalid after calling this method. */ @Override public void close() throws SQLException { try { super.close(); batchParameters = null; if (command != null) { command.close(); command = null; } } catch (Exception e) { throw logAndConvert(e); } }
/** * Read the serializer name from the persistent database settings. * * @return the serializer */ private String readSerializationSettings() { String javaObjectSerializerFQN = null; CommandInterface ci = prepareCommand( "SELECT VALUE FROM INFORMATION_SCHEMA.SETTINGS "+ " WHERE NAME='JAVA_OBJECT_SERIALIZER'", Integer.MAX_VALUE); try { ResultInterface result = ci.executeQuery(0, false); if (result.next()) { Value[] row = result.currentRow(); javaObjectSerializerFQN = row[0].getString(); } } finally { ci.close(); } return javaObjectSerializerFQN; }
/** * Gets the current catalog name. * * @return the catalog name * @throws SQLException if the connection is closed */ @Override public String getCatalog() throws SQLException { try { debugCodeCall("getCatalog"); checkClosed(); if (catalog == null) { CommandInterface cat = prepareCommand("CALL DATABASE()", Integer.MAX_VALUE); ResultInterface result = cat.executeQuery(0, false); result.next(); catalog = result.currentRow()[0].getString(); cat.close(); } return catalog; } catch (Exception e) { throw logAndConvert(e); } }
private int executeUpdateInternal(String sql, Object generatedKeysRequest) throws SQLException { checkClosedForWrite(); try { closeOldResultSet(); sql = JdbcConnection.translateSQL(sql, escapeProcessing); CommandInterface command = conn.prepareCommand(sql, fetchSize); synchronized (session) { setExecutingStatement(command); try { ResultWithGeneratedKeys result = command.executeUpdate( conn.scopeGeneratedKeys() ? false : generatedKeysRequest); updateCount = result.getUpdateCount(); ResultInterface gk = result.getGeneratedKeys(); if (gk != null) { int id = getNextId(TraceObject.RESULT_SET); generatedKeys = new JdbcResultSet(conn, this, command, gk, id, false, true, false); } } finally { setExecutingStatement(null); } } command.close(); return updateCount; } finally { afterWriting(); } }
command.close();
command.close();
private static CommandInterface closeAndSetNull(CommandInterface command) { if (command != null) { command.close(); } return null; }
private CommandInterface closeAndSetNull(CommandInterface command) { if (command != null) { command.close(); } return null; }
private static CommandInterface closeAndSetNull(CommandInterface command) { if (command != null) { command.close(); } return null; }
/** * Closes this statement. * All result sets that where created by this statement * become invalid after calling this method. */ public void close() throws SQLException { try { super.close(); if (command != null) { command.close(); command = null; } } catch (Throwable e) { throw logAndConvert(e); } }
/** * Closes this statement. * All result sets that where created by this statement * become invalid after calling this method. */ @Override public void close() throws SQLException { try { super.close(); batchParameters = null; if (command != null) { command.close(); command = null; } } catch (Exception e) { throw logAndConvert(e); } }
/** * Closes this statement. * All result sets that where created by this statement * become invalid after calling this method. */ @Override public void close() throws SQLException { try { super.close(); batchParameters = null; if (command != null) { command.close(); command = null; } } catch (Exception e) { throw logAndConvert(e); } }
/** * Read the serializer name from the persistent database settings. * * @return the serializer */ private String readSerializationSettings() { String javaObjectSerializerFQN = null; CommandInterface ci = prepareCommand( "SELECT VALUE FROM INFORMATION_SCHEMA.SETTINGS "+ " WHERE NAME='JAVA_OBJECT_SERIALIZER'", Integer.MAX_VALUE); try { ResultInterface result = ci.executeQuery(0, false); if (result.next()) { Value[] row = result.currentRow(); javaObjectSerializerFQN = row[0].getString(); } } finally { ci.close(); } return javaObjectSerializerFQN; }
/** * Read the serializer name from the persistent database settings. * * @return the serializer */ private String readSerializationSettings() { String javaObjectSerializerFQN = null; CommandInterface ci = prepareCommand( "SELECT VALUE FROM INFORMATION_SCHEMA.SETTINGS "+ " WHERE NAME='JAVA_OBJECT_SERIALIZER'", Integer.MAX_VALUE); try { ResultInterface result = ci.executeQuery(0, false); if (result.next()) { Value[] row = result.currentRow(); javaObjectSerializerFQN = row[0].getString(); } } finally { ci.close(); } return javaObjectSerializerFQN; }
/** * Gets the current catalog name. * * @throws SQLException * if the connection is closed */ public String getCatalog() throws SQLException { try { debugCodeCall("getCatalog"); checkClosed(); if (catalog == null) { CommandInterface cat = prepareCommand("CALL DATABASE()", Integer.MAX_VALUE); ResultInterface result = cat.executeQuery(0, false); result.next(); catalog = result.currentRow()[0].getString(); cat.close(); } return catalog; } catch (Throwable e) { throw logAndConvert(e); } }
private int executeUpdateInternal(String sql) throws SQLException { checkClosedForWrite(); try { closeOldResultSet(); sql = JdbcConnection.translateSQL(sql, escapeProcessing); CommandInterface command = conn.prepareCommand(sql, fetchSize); synchronized (session) { setExecutingStatement(command); try { updateCount = command.executeUpdate(); } finally { setExecutingStatement(null); } } command.close(); return updateCount; } finally { afterWriting(); } }
private int executeUpdateInternal(String sql) throws SQLException { checkClosedForWrite(); try { closeOldResultSet(); sql = JdbcConnection.translateSQL(sql, escapeProcessing); CommandInterface command = conn.prepareCommand(sql, fetchSize); synchronized (session) { setExecutingStatement(command); try { updateCount = command.executeUpdate(); } finally { setExecutingStatement(null); } } command.close(); return updateCount; } finally { afterWriting(); } }
/** * Gets the current catalog name. * * @return the catalog name * @throws SQLException if the connection is closed */ @Override public String getCatalog() throws SQLException { try { debugCodeCall("getCatalog"); checkClosed(); if (catalog == null) { CommandInterface cat = prepareCommand("CALL DATABASE()", Integer.MAX_VALUE); ResultInterface result = cat.executeQuery(0, false); result.next(); catalog = result.currentRow()[0].getString(); cat.close(); } return catalog; } catch (Exception e) { throw logAndConvert(e); } }