| Modifier and Type | Field and Description |
|---|---|
| private static boolean | |
| private static String[] | |
| private static HashSet | |
| private static final String[] | |
| public static JavaObjectSerializer | serializer
The serializer to use. |
| private static final ArrayList | userClassFactories
In order to manage more than one class loader |
| private static final byte[] |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | addClassFactory(Utils.
An object that implements ClassFactory classFactoryAdd a class factory in order to manage more than one class loader. |
| private static void | |
| public static void | |
| public static void | closeSilently(Connection
the connection or null conn)Close a connection without throwing an exception. |
| public static void | |
| public static Object | Returns: the objectthe byte array data, JavaObjectSerializer the object serializer (may be null) javaObjectSerializer)De-serialize the byte array to an object, eventually using the serializer specified by the connection info. |
| public static ValueUuid | Returns: the UUID objectthe byte array data)De-serialize the byte array to a UUID object. |
| public static Connection | Returns: the database connectionthe driver class name driver, String the database URL url, String the user name user, String the password password)Open a new database connection with the given settings. |
| public static Connection | Returns: the database connectionthe driver class name driver, String the database URL url, String the user name or user, String nullthe password or password, NetworkConnectionInfo nullthe network connection information, or networkConnectionInfo, boolean nullwhether database creation is forbidden forbidCreation)Open a new database connection with the given settings. |
| public static String | |
| public static ResultSet | Returns: the metadatathe connection conn, String the SQL statement sql)Get metadata from the database. |
| public static boolean | |
| public static void | |
| public static < generic return type Z> Class | Returns: the class objectthe name of the class className)Load a class, but check if it is allowed to load this class first. |
| public static void | removeClassFactory(Utils.
Already inserted class factory instance classFactoryRemove a class factory |
| public static byte[] | Returns: the byte arraythe object to serialize obj, JavaObjectSerializer the object serializer (may be null) javaObjectSerializer)Serialize the object to a byte array, using the serializer specified by the connection info if set, or the default serializer. |
| public static void | set(PreparedStatement
the prepared statement prep, int the parameter index parameterIndex, Value the value value, JdbcConnection the own connection conn)Set a value as a parameter in a prepared statement. |
| private static void | |
| private static void | |
| public static String[] |
| allowAllClasses | back to summary |
|---|---|
| private static boolean allowAllClasses | |
| allowedClassNamePrefixes | back to summary |
|---|---|
| private static String[] allowedClassNamePrefixes | |
| allowedClassNames | back to summary |
|---|---|
| private static HashSet<String> allowedClassNames | |
| DRIVERS | back to summary |
|---|---|
| private static final String[] DRIVERS | |
| serializer | back to summary |
|---|---|
| public static JavaObjectSerializer serializer The serializer to use. | |
| userClassFactories | back to summary |
|---|---|
| private static final ArrayList<Utils. In order to manage more than one class loader | |
| UUID_PREFIX | back to summary |
|---|---|
| private static final byte[] UUID_PREFIX | |
| JdbcUtils | back to summary |
|---|---|
| private JdbcUtils() | |
| addClassFactory | back to summary |
|---|---|
| public static void addClassFactory(Utils. Add a class factory in order to manage more than one class loader.
| |
| addDatabaseMetaData | back to summary |
|---|---|
| private static void addDatabaseMetaData(SimpleResultSet rs, DatabaseMetaData meta) | |
| closeSilently | back to summary |
|---|---|
| public static void closeSilently(Statement stat) Close a statement without throwing an exception.
| |
| closeSilently | back to summary |
|---|---|
| public static void closeSilently(Connection conn) Close a connection without throwing an exception.
| |
| closeSilently | back to summary |
|---|---|
| public static void closeSilently(ResultSet rs) Close a result set without throwing an exception.
| |
| deserialize | back to summary |
|---|---|
| public static Object deserialize(byte[] data, JavaObjectSerializer javaObjectSerializer) De-serialize the byte array to an object, eventually using the serializer specified by the connection info.
| |
| deserializeUuid | back to summary |
|---|---|
| public static ValueUuid deserializeUuid(byte[] data) De-serialize the byte array to a UUID object. This method is called on
the server side where regular de-serialization of user-supplied Java
objects may create a security hole if object was maliciously crafted.
Unlike
| |
| getConnection | back to summary |
|---|---|
| public static Connection getConnection(String driver, String url, String user, String password) throws SQLException Open a new database connection with the given settings.
| |
| getConnection | back to summary |
|---|---|
| public static Connection getConnection(String driver, String url, String user, String password, NetworkConnectionInfo networkConnectionInfo, boolean forbidCreation) throws SQLException Open a new database connection with the given settings.
| |
| getDriver | back to summary |
|---|---|
| public static String getDriver(String url) Get the driver class name for the given URL, or null if the URL is unknown. | |
| getMetaResultSet | back to summary |
|---|---|
| public static ResultSet getMetaResultSet(Connection conn, String sql) throws SQLException Get metadata from the database.
| |
| isBuiltIn | back to summary |
|---|---|
| public static boolean isBuiltIn(String sql, String builtIn) Check is the SQL string starts with a prefix (case insensitive). | |
| load | back to summary |
|---|---|
| public static void load(String url) Load the driver class for the given URL, if the database URL is known.
| |
| loadUserClass | back to summary |
|---|---|
| public static <Z> Class Load a class, but check if it is allowed to load this class first. To perform access rights checking, the system property h2.allowedClasses needs to be set to a list of class file name prefixes.
| |
| removeClassFactory | back to summary |
|---|---|
| public static void removeClassFactory(Utils. Remove a class factory
| |
| serialize | back to summary |
|---|---|
| public static byte[] serialize(Object obj, JavaObjectSerializer javaObjectSerializer) Serialize the object to a byte array, using the serializer specified by the connection info if set, or the default serializer.
| |
| set | back to summary |
|---|---|
| public static void set(PreparedStatement prep, int parameterIndex, Value value, JdbcConnection conn) throws SQLException Set a value as a parameter in a prepared statement.
| |
| setLob | back to summary |
|---|---|
| private static void setLob(PreparedStatement prep, int parameterIndex, ValueLob value) throws SQLException | |
| setOther | back to summary |
|---|---|
| private static void setOther(PreparedStatement prep, int parameterIndex, Value value, JdbcConnection conn) throws SQLException | |
| split | back to summary |
|---|---|
| public static String[] split(String s) Split the string using the space separator into at least 10 entries. | |