Fields
- =public static final int CLOSE_ALL_RESULTS = 3
- =public static final int CLOSE_CURRENT_RESULT = 1
- =public static final int EXECUTE_FAILED = -3
- =public static final int KEEP_CURRENT_RESULT = 2
- =public static final int NO_GENERATED_KEYS = 2
- =public static final int RETURN_GENERATED_KEYS = 1
- =public static final int SUCCESS_NO_INFO = -2
Methods
- =public abstract void addBatch(java.lang.String arg0) throws java.sql.SQLException
- =public abstract void cancel() throws java.sql.SQLException
- =public abstract void clearBatch() throws java.sql.SQLException
- =public abstract void clearWarnings() throws java.sql.SQLException
- =public abstract void close() throws java.sql.SQLException
- =public abstract void closeOnCompletion() throws java.sql.SQLException
- ≠public default java.lang.String enquoteIdentifier(java.lang.String arg0, boolean arg1) throws java.sql.SQLExceptionComparing JDBC 4.4 and JDBC 4.5
enquoteIdentifier
default String enquoteIdentifier(String identifier, boolean alwaysQuoteboolean alwaysDelimit) throws SQLException Returns asimple Moved to a link with destination #isSimpleIdentifier(java.lang.String).Moved to a computer code block.SQL identifierMoved to a link with destination #isSimpleIdentifier(java.lang.String).Moved to a computer code block. or a delimited identifier. A delimited identifier represents the name of a database object such as a table, column, or view that is enclosed by a delimiter, which is typically a double quote as defined by the SQL standard.Moved to a paragraph. Moved to a paragraph.If
Moved to a paragraph.identifierMoved to a paragraph. is a simple SQL identifier: Moved out of an unordered list.Moved to a paragraph.- Return If
alwaysDelimitisfalse, return the original value - if
alwaysQuoteisfalseReturnalwaysDelimitistrue, enquote the original value and return as a delimited identifier ifalwaysQuoteistrue
Moved to a paragraph. Moved to a paragraph.If
Moved to a paragraph.identifierMoved to a paragraph. is not a simple SQL identifier,identifierwill be enclosed in double quotes if not already present. IfMoved to a paragraph. Moved to a paragraph.the
datasource does not support double quotes forMoved to a paragraph. Moved to a paragraph.delimited
identifiers, the
shouldMoved to a paragraph.Moved to a computer code block.identifierto Moved to a paragraph.be returned must be Moved to a paragraph.enclosed by the
stringdelimiter Moved to a paragraph.returned from
should beMoved to a paragraph.DatabaseMetaData.getIdentifierQuoteString()Moved to a paragraph.. If the datasource does not support delimited identifiers, aMoved to a paragraph.SQLFeatureNotSupportedExceptionis Moved to a paragraph.thrown.
A
SQLExceptionwill be thrown ifidentifiercontains any invalid characters invalid in within a delimited identifier or the identifier length is invalid for the datasource.- Implementation Requirements:
- The default implementation uses the following criteria to determine a valid simple SQL identifier:
- The string is not enclosed in double quotes
- The first character is an alphabetic character from a (
'\0061') through z ('\u007A'), or from A ('\u0041') through Z ('\u005A') - The name only contains alphanumeric characters([0-9A-Za-z]) or the character "_"
SQLExceptionif:-
DatabaseMetaData.getIdentifierQuoteString()does not return a double quote identifiercontains anullcharacter or double quote and is not a simple SQL identifier.- The length of
identifieris less than 1 or greater than 128 characters
Examples of the conversion: identifieralwaysQuote alwaysDelimit Result Hello false Hello Hello true "Hello" G'Day false "G'Day" "Bruce Wayne" false "Bruce Wayne" "Bruce Wayne" true "Bruce Wayne" "select" false "select" "select" true "select" GoodDay$ false "GoodDay$" Hello"World false SQLException "Hello"World" false SQLException - Implementation Note:
- JDBC driver implementations may need to provide their own implementation of this method in order to meet the requirements of the underlying datasource.
- Parameters:
identifier- a SQL identifieralwaysQuotealwaysDelimit- indicates if a simple SQL identifier should be returned as a quoted delimited identifier- Returns:
- A simple SQL identifier or a delimited identifier
- Throws:
SQLException- if identifier is not a valid identifierSQLFeatureNotSupportedException- if the datasource does not support delimited identifiersNullPointerException- if identifier isnull- Since:
- 9
- Return If
- ≠public default java.lang.String enquoteLiteral(java.lang.String arg0) throws java.sql.SQLExceptionComparing JDBC 4.4 and JDBC 4.5
enquoteLiteral
Returns aStringenclosed in single quotes. Any occurrence of a single quote within the string will be replaced by two single quotes.Examples of the conversion: Value Result Hello 'Hello' G'Day 'G''Day' 'G''Day' '''G''''Day''' I'''M 'I''''''M' - Implementation Requirements:
- The default implementation creates the literal as:
"'" + val.replace("'", "''") + "'". - Implementation Note:
- JDBC driver implementations may need to provide their own implementation of this method in order to meet the requirements of the underlying datasource.
- Parameters:
val- a character string- Returns:
- A string enclosed by single quotes with every single quote converted to two single quotes
- Throws:
NullPointerException- if val isnullSQLException- if a database access error occurs- Since:
- 9
- ≠public default java.lang.String enquoteNCharLiteral(java.lang.String arg0) throws java.sql.SQLExceptionComparing JDBC 4.4 and JDBC 4.5
enquoteNCharLiteral
Returns aStringrepresenting a National Character Set Literal enclosed in single quotes and prefixed with a upper case letter N. Any occurrence of a single quote within the string will be replaced by two single quotes.Examples of the conversion: Value Result Hello N'Hello' G'Day N'G''Day' 'G''Day' N'''G''''Day''' I'''M N'I''''''M' N'Hello' N'N''Hello''' - Implementation Requirements:
- The default implementation creates the literal as:
"N'" + val.replace("'", "''") + "'". - Implementation Note:
- JDBC driver implementations may need to provide their own implementation of this method in order to meet the requirements of the underlying datasource. An implementation of enquoteNCharLiteral may accept a different set of characters than that accepted by the same drivers implementation of enquoteLiteral.
- Parameters:
val- a character string- Returns:
- the result of replacing every single quote character in the argument by two single quote characters where this entire result is then prefixed with 'N'.
- Throws:
NullPointerException- if val isnullSQLException- if a database access error occurs- Since:
- 9
- =public abstract boolean execute(java.lang.String arg0) throws java.sql.SQLException
- =public abstract boolean execute(java.lang.String arg0, int arg1) throws java.sql.SQLException
- =public abstract boolean execute(java.lang.String arg0, int[] arg1) throws java.sql.SQLException
- =public abstract boolean execute(java.lang.String arg0, java.lang.String[] arg1) throws java.sql.SQLException
- =public abstract int[] executeBatch() throws java.sql.SQLException
- =public default long[] executeLargeBatch() throws java.sql.SQLException
- =public default long executeLargeUpdate(java.lang.String arg0) throws java.sql.SQLException
- =public default long executeLargeUpdate(java.lang.String arg0, int arg1) throws java.sql.SQLException
- =public default long executeLargeUpdate(java.lang.String arg0, int[] arg1) throws java.sql.SQLException
- =public default long executeLargeUpdate(java.lang.String arg0, java.lang.String[] arg1) throws java.sql.SQLException
- =public abstract java.sql.ResultSet executeQuery(java.lang.String arg0) throws java.sql.SQLException
- =public abstract int executeUpdate(java.lang.String arg0) throws java.sql.SQLException
- =public abstract int executeUpdate(java.lang.String arg0, int arg1) throws java.sql.SQLException
- =public abstract int executeUpdate(java.lang.String arg0, int[] arg1) throws java.sql.SQLException
- =public abstract int executeUpdate(java.lang.String arg0, java.lang.String[] arg1) throws java.sql.SQLException
- =public abstract java.sql.Connection getConnection() throws java.sql.SQLException
- =public abstract int getFetchDirection() throws java.sql.SQLException
- =public abstract int getFetchSize() throws java.sql.SQLException
- =public abstract java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException
- =public default long getLargeMaxRows() throws java.sql.SQLException
- =public default long getLargeUpdateCount() throws java.sql.SQLException
- =public abstract int getMaxFieldSize() throws java.sql.SQLException
- =public abstract int getMaxRows() throws java.sql.SQLException
- =public abstract boolean getMoreResults() throws java.sql.SQLException
- =public abstract boolean getMoreResults(int arg0) throws java.sql.SQLException
- =public abstract int getQueryTimeout() throws java.sql.SQLException
- =public abstract java.sql.ResultSet getResultSet() throws java.sql.SQLException
- =public abstract int getResultSetConcurrency() throws java.sql.SQLException
- =public abstract int getResultSetHoldability() throws java.sql.SQLException
- =public abstract int getResultSetType() throws java.sql.SQLException
- =public abstract int getUpdateCount() throws java.sql.SQLException
- =public abstract java.sql.SQLWarning getWarnings() throws java.sql.SQLException
- =public abstract boolean isCloseOnCompletion() throws java.sql.SQLException
- =public abstract boolean isClosed() throws java.sql.SQLException
- =public abstract boolean isPoolable() throws java.sql.SQLException
- ≠public default boolean isSimpleIdentifier(java.lang.String arg0) throws java.sql.SQLExceptionComparing JDBC 4.4 and JDBC 4.5
isSimpleIdentifier
Retrieves Returns whetheridentifieris a simple SQL identifier. A simple SQL identifier is referred to as regular (or ordinary) identifier within the SQL standard. A regular identifier represents the name of a database object such as a table, column, or view.Moved to a paragraph. The rules for a regular Identifier are:
- The first character is an alphabetic character from a (
'\u0061') through z ('\u007A'), or from A ('\u0041') through Z ('\u005A') - The name only contains alphanumeric characters([0-9A-Za-z]) or the character "_"
- It cannot be a SQL reserved word
A datasource may have additional rules for a regular identifier such as:
- Supports additional characters within the name based on the locale being used
- Supports a different maximum length for the identifier
- Implementation Requirements:
- The default implementation uses the following criteria to determine a valid simple SQL identifier:
- The string identifier is not enclosed in double quotes
- The first character is an alphabetic character from a through z, or from A through Z
- The string identifier only contains alphanumeric characters([0-9A-Za-z]) or the character "_"
- The identifier is not a SQL reserved word
- The identifier is string is between 1 and 128 characters in length inclusive
Examples of the conversion: identifier Simple Identifier Hello true G'Day false "Bruce Wayne" false GoodDay$ false Hello"World false "Hello"World" false "select" false "from" false - Implementation Note:
- JDBC driver implementations may need to provide their own implementation of this method in order to meet the requirements of the underlying datasource.
- Parameters:
identifier- a SQL identifier- Returns:
- true if a simple SQL identifier, false otherwise
- Throws:
NullPointerException- if identifier isnullSQLException- if a database access error occurs- Since:
- 9
- The first character is an alphabetic character from a (
- =public abstract void setCursorName(java.lang.String arg0) throws java.sql.SQLException
- =public abstract void setEscapeProcessing(boolean arg0) throws java.sql.SQLException
- =public abstract void setFetchDirection(int arg0) throws java.sql.SQLException
- =public abstract void setFetchSize(int arg0) throws java.sql.SQLException
- =public default void setLargeMaxRows(long arg0) throws java.sql.SQLException
- =public abstract void setMaxFieldSize(int arg0) throws java.sql.SQLException
- =public abstract void setMaxRows(int arg0) throws java.sql.SQLException
- =public abstract void setPoolable(boolean arg0) throws java.sql.SQLException
- =public abstract void setQueryTimeout(int arg0) throws java.sql.SQLException
Summary
| Elements | Comments | Descriptions | Total | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed | ||
| enquoteIdentifier(String,boolean) | 24 | 8 | 16 | 48 | ||||||
| enquoteLiteral(String) | 3 | 3 | ||||||||
| enquoteNCharLiteral(String) | 3 | 3 | ||||||||
| isSimpleIdentifier(String) | 18 | 4 | 22 | |||||||
| Total | 48 | 12 | 16 | 76 | ||||||