protected java.sql.Statement createMetaDataStatement() throws SQLException { return ((AbstractJdbc2Connection)connection).createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY); }
public abstract java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException;
protected int getMaxNameLength() throws SQLException { if (NAMEDATALEN == 0) { String sql; if (connection.haveMinimumServerVersion("7.3")) { sql = "SELECT t.typlen FROM pg_catalog.pg_type t, pg_catalog.pg_namespace n WHERE t.typnamespace=n.oid AND t.typname='name' AND n.nspname='pg_catalog'"; } else { sql = "SELECT typlen FROM pg_type WHERE typname='name'"; } ResultSet rs = connection.createStatement().executeQuery(sql); if (!rs.next()) { throw new PSQLException(GT.tr("Unable to find name datatype in the system catalogs."), PSQLState.UNEXPECTED_ERROR); } NAMEDATALEN = rs.getInt("typlen"); rs.close(); } return NAMEDATALEN - 1; }
protected int getMaxIndexKeys() throws SQLException { if (INDEX_MAX_KEYS == 0) { String sql; if (connection.haveMinimumServerVersion("8.0")) { sql = "SELECT setting FROM pg_catalog.pg_settings WHERE name='max_index_keys'"; } else { String from; if (connection.haveMinimumServerVersion("7.3")) { from = "pg_catalog.pg_namespace n, pg_catalog.pg_type t1, pg_catalog.pg_type t2 WHERE t1.typnamespace=n.oid AND n.nspname='pg_catalog' AND "; } else { from = "pg_type t1, pg_type t2 WHERE "; } sql = "SELECT t1.typlen/t2.typlen FROM " + from + " t1.typelem=t2.oid AND t1.typname='oidvector'"; } ResultSet rs = connection.createStatement().executeQuery(sql); if (!rs.next()) { throw new PSQLException(GT.tr("Unable to determine a value for MaxIndexKeys due to missing system catalog data."), PSQLState.UNEXPECTED_ERROR); } INDEX_MAX_KEYS = rs.getInt(1); rs.close(); } return INDEX_MAX_KEYS; }
ResultSet rs = connection.createStatement().executeQuery(sql); while (rs.next())
public void execSQLUpdate(String s) throws SQLException { BaseStatement stmt = (BaseStatement) createStatement(); if (stmt.executeWithFlags(s, QueryExecutor.QUERY_NO_METADATA | QueryExecutor.QUERY_NO_RESULTS | QueryExecutor.QUERY_SUPPRESS_BEGIN)) throw new PSQLException(GT.tr("A result was returned when none was expected."), PSQLState.TOO_MANY_RESULTS); // Transfer warnings to the connection, since the user never // has a chance to see the statement itself. SQLWarning warnings = stmt.getWarnings(); if (warnings != null) addWarning(warnings); stmt.close(); }
ResultSet rs = connection.createStatement().executeQuery(sql); while (rs.next())
ResultSet rs = connection.createStatement().executeQuery(sql);
ResultSet rs = connection.createStatement().executeQuery(sql); while (rs.next()) ResultSet columnrs = connection.createStatement().executeQuery(columnsql); while (columnrs.next())
/** * Simple query execution. */ public ResultSet execSQLQuery(String s, int resultSetType, int resultSetConcurrency) throws SQLException { BaseStatement stat = (BaseStatement) createStatement(resultSetType, resultSetConcurrency); boolean hasResultSet = stat.executeWithFlags(s, QueryExecutor.QUERY_SUPPRESS_BEGIN); while (!hasResultSet && stat.getUpdateCount() != -1) hasResultSet = stat.getMoreResults(); if (!hasResultSet) throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA); // Transfer warnings to the connection, since the user never // has a chance to see the statement itself. SQLWarning warnings = stat.getWarnings(); if (warnings != null) addWarning(warnings); return stat.getResultSet(); }
" ORDER BY a.attnum "; ResultSet rs = connection.createStatement().executeQuery(sql); while (rs.next())
ResultSet rs = connection.createStatement().executeQuery(sql); while (rs.next())
ResultSet rs = connection.createStatement().executeQuery(sql);
protected java.sql.Statement createMetaDataStatement() throws SQLException { return ((AbstractJdbc2Connection)connection).createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY); }
protected java.sql.Statement createMetaDataStatement() throws SQLException { return ((AbstractJdbc2Connection)connection).createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY); }
public abstract java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException;
public abstract java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException;
public void execSQLUpdate(String s) throws SQLException { BaseStatement stmt = (BaseStatement) createStatement(); if (stmt.executeWithFlags(s, QueryExecutor.QUERY_NO_METADATA | QueryExecutor.QUERY_NO_RESULTS | QueryExecutor.QUERY_SUPPRESS_BEGIN)) throw new PSQLException(GT.tr("A result was returned when none was expected."), PSQLState.TOO_MANY_RESULTS); // Transfer warnings to the connection, since the user never // has a chance to see the statement itself. SQLWarning warnings = stmt.getWarnings(); if (warnings != null) addWarning(warnings); stmt.close(); }
public void execSQLUpdate(String s) throws SQLException { BaseStatement stmt = (BaseStatement) createStatement(); if (stmt.executeWithFlags(s, QueryExecutor.QUERY_NO_METADATA | QueryExecutor.QUERY_NO_RESULTS | QueryExecutor.QUERY_SUPPRESS_BEGIN)) throw new PSQLException(GT.tr("A result was returned when none was expected."), PSQLState.TOO_MANY_RESULTS); // Transfer warnings to the connection, since the user never // has a chance to see the statement itself. SQLWarning warnings = stmt.getWarnings(); if (warnings != null) addWarning(warnings); stmt.close(); }
/** * Simple query execution. */ public ResultSet execSQLQuery(String s, int resultSetType, int resultSetConcurrency) throws SQLException { BaseStatement stat = (BaseStatement) createStatement(resultSetType, resultSetConcurrency); boolean hasResultSet = stat.executeWithFlags(s, QueryExecutor.QUERY_SUPPRESS_BEGIN); while (!hasResultSet && stat.getUpdateCount() != -1) hasResultSet = stat.getMoreResults(); if (!hasResultSet) throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA); // Transfer warnings to the connection, since the user never // has a chance to see the statement itself. SQLWarning warnings = stat.getWarnings(); if (warnings != null) addWarning(warnings); return stat.getResultSet(); }