| 1 |
/* |
| 2 |
* Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, |
| 3 |
* and the EPL 1.0 (https://h2database.com/html/license.html). |
| 4 |
* Initial Developer: H2 Group |
| 5 |
*/ |
| 6 |
package org.h2.jdbc; |
| 7 |
|
| 8 |
import java.sql.SQLException; |
| 9 |
|
| 10 |
/** |
| 11 |
* Allows us to compile on older platforms, while still implementing the methods |
| 12 |
* from the newer JDBC API. |
| 13 |
*/ |
| 14 |
public interface JdbcStatementBackwardsCompat { |
| 15 |
|
| 16 |
// compatibility interface |
| 17 |
|
| 18 |
// JDBC 4.3 (incomplete) |
| 19 |
|
| 20 |
/** |
| 21 |
* Enquotes the specified identifier. |
| 22 |
* |
| 23 |
* @param identifier |
| 24 |
* identifier to quote if required |
| 25 |
* @param alwaysQuote |
| 26 |
* if {@code true} identifier will be quoted unconditionally |
| 27 |
* @return specified identifier quoted if required or explicitly requested |
| 28 |
* @throws SQLException on failure |
| 29 |
*/ |
| 30 |
String enquoteIdentifier(String identifier, boolean alwaysQuote) throws SQLException; |
| 31 |
|
| 32 |
/** |
| 33 |
* Checks if specified identifier may be used without quotes. |
| 34 |
* |
| 35 |
* @param identifier |
| 36 |
* identifier to check |
| 37 |
* @return is specified identifier may be used without quotes |
| 38 |
* @throws SQLException on failure |
| 39 |
*/ |
| 40 |
boolean isSimpleIdentifier(String identifier) throws SQLException; |
| 41 |
} |