public boolean supportsTransactionIsolationLevel(int level) throws SQLException { if (level == Connection.TRANSACTION_SERIALIZABLE || level == Connection.TRANSACTION_READ_COMMITTED) return true; else if (connection.haveMinimumServerVersion("8.0") && (level == Connection.TRANSACTION_READ_UNCOMMITTED || level == Connection.TRANSACTION_REPEATABLE_READ)) return true; else return false; }
public String getSystemFunctions() throws SQLException { if (connection.haveMinimumServerVersion("7.3")){ return EscapedFunctions.DATABASE+','+EscapedFunctions.IFNULL+ ','+EscapedFunctions.USER; } else { return EscapedFunctions.IFNULL+ ','+EscapedFunctions.USER; } }
public int getMaxStatementLength() throws SQLException { if (connection.haveMinimumServerVersion("7.0")) return 0; // actually whatever fits in size_t else return 16384; }
/** * Retrieves whether this database supports savepoints. * * @return <code>true</code> if savepoints are supported; * <code>false</code> otherwise * @exception SQLException if a database access error occurs * @since 1.4 */ public boolean supportsSavepoints() throws SQLException { return connection.haveMinimumServerVersion("8.0"); }
public int getMaxRowSize() throws SQLException { if (connection.haveMinimumServerVersion("7.1")) return 1073741824; // 1 GB else return 8192; // XXX could be altered }
public boolean supportsGroupByUnrelated() throws SQLException { return connection.haveMinimumServerVersion("6.4"); }
public boolean supportsSchemasInProcedureCalls() throws SQLException { return connection.haveMinimumServerVersion("7.3"); }
public boolean supportsSchemasInIndexDefinitions() throws SQLException { return connection.haveMinimumServerVersion("7.3"); }
public boolean supportsLimitedOuterJoins() throws SQLException { return connection.haveMinimumServerVersion("7.1"); }
public boolean supportsSchemasInTableDefinitions() throws SQLException { return connection.haveMinimumServerVersion("7.3"); }
public boolean supportsANSI92EntryLevelSQL() throws SQLException { return connection.haveMinimumServerVersion("7.3"); }
public boolean supportsSchemasInDataManipulation() throws SQLException { return connection.haveMinimumServerVersion("7.3"); }
public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException { return connection.haveMinimumServerVersion("7.3"); }
public boolean supportsUnionAll() throws SQLException { return connection.haveMinimumServerVersion("7.1"); }
public boolean nullsAreSortedHigh() throws SQLException { return connection.haveMinimumServerVersion("7.2"); }
public boolean nullsAreSortedAtEnd() throws SQLException { return !connection.haveMinimumServerVersion("7.2"); }
public boolean supportsAlterTableWithDropColumn() throws SQLException { return connection.haveMinimumServerVersion("7.3"); }
public boolean supportsOrderByUnrelated() throws SQLException { return connection.haveMinimumServerVersion("6.4"); }
public boolean supportsLikeEscapeClause() throws SQLException { return connection.haveMinimumServerVersion("7.1"); }
public void setReadOnly(boolean readOnly) throws SQLException { checkClosed(); if (protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE) throw new PSQLException(GT.tr("Cannot change transaction read-only property in the middle of a transaction."), PSQLState.ACTIVE_SQL_TRANSACTION); if (haveMinimumServerVersion("7.4") && readOnly != this.readOnly) { String readOnlySql = "SET SESSION CHARACTERISTICS AS TRANSACTION " + (readOnly ? "READ ONLY" : "READ WRITE"); execSQLUpdate(readOnlySql); // nb: no BEGIN triggered. } this.readOnly = readOnly; }