726N/A * The contents of this file are subject to the terms of the 726N/A * Common Development and Distribution License (the "License"). 726N/A * You may not use this file except in compliance with the License. 726N/A * language governing permissions and limitations under the License. 726N/A * When distributing Covered Code, include this CDDL HEADER in each 726N/A * If applicable, add the following below this CDDL HEADER, with the 726N/A * fields enclosed by brackets "[]" replaced with your own identifying 726N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1338N/A * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 726N/A * Class that manages the resources associated with a database connection. 726N/A * This includes a cache of {@code PreparedStatement}s. 726N/A /** The connection to the database. */ 726N/A /** Statement cache. */ 726N/A * Create a new {@code ConnectionResource} instance. 726N/A * @param manager the {@code ConnectionManager} that created this object 726N/A * @throws SQLException if an error occurs when connecting to the database 862N/A * Check if the connection is still valid. 862N/A * @return {@code true} if the connection is valid, {@code false} if not 862N/A * @throws SQLException if a database error occurs 862N/A // Check whether the connection is valid. Assume that the connection 862N/A // is lost if there's no response after 10 seconds. (Will normally 862N/A // return immediately if the connection is lost, but use a timeout 862N/A // in case of odd network issues.) 726N/A * Commit the transaction. 726N/A * @throws SQLException if a database error occurs 726N/A * Abort the transaction. 726N/A * @throws SQLException if a database error occurs 726N/A * Get a {@code PreparedStatement} as defined by the specified 726N/A * {@code StatementCreator}. If it is the first time the statement 726N/A * creator is used on this {@code ConnectionResource}, the creator's 726N/A * {@link StatementCreator#create(Connection)} method is called to 726N/A * create a new {@code PreparedStatement}. This statement is cached, 726N/A * so that on subsequent calls with the same statement creator, the same 726N/A * {@code PreparedStatement} will be returned. 726N/A * @param creator object that specifies how to create the statement if 726N/A * @return a {@code PreparedStatement} object 726N/A * @throws SQLException if a database error occurs 726N/A * Create a new {@code Statement} object. 726N/A * @return a {@code Statement} object 726N/A * @throws java.sql.SQLException 747N/A * Prepare a statement. This method should only be used to prepare 747N/A * statements that are used infrequently. If a statement is likely to 747N/A * be used frequently, a {@code StatementCreator} object should be 747N/A * created for it, and the method {@link #getStatement(StatementCreator)} 747N/A * should be used instead. 747N/A * @param sql the SQL text to compile 747N/A * @return a prepared statement 747N/A * @throws SQLException if a database error occurs 747N/A * Get a meta-data object for the underlying connection. 747N/A * @return a {@code DatabaseMetaData} object 747N/A * @throws SQLException if a database error occurs