📄 csvconnection.java
字号:
* pre-compiled SQL statement
* @exception SQLException if a database access error occurs
*/
public CallableStatement prepareCall(String sql) throws SQLException {
throw new UnsupportedOperationException(
"Connection.prepareCall(String) unsupported");
}
/**
* Converts the given SQL statement into the system's native SQL grammar.
* A driver may convert the JDBC SQL grammar into its system's
* native SQL grammar prior to sending it. This method returns the
* native form of the statement that the driver would have sent.
*
* @param sql an SQL statement that may contain one or more '?'
* parameter placeholders
* @return the native form of this statement
* @exception SQLException if a database access error occurs
*/
public String nativeSQL(String sql) throws SQLException {
throw new UnsupportedOperationException(
"Connection.nativeSQL(String) unsupported");
}
/**
* Sets this connection's auto-commit mode to the given state.
* If a connection is in auto-commit mode, then all its SQL
* statements will be executed and committed as individual
* transactions. Otherwise, its SQL statements are grouped into
* transactions that are terminated by a call to either
* the method <code>commit</code> or the method <code>rollback</code>.
* By default, new connections are in auto-commit
* mode.
* <P>
* The commit occurs when the statement completes or the next
* execute occurs, whichever comes first. In the case of
* statements returning a <code>ResultSet</code> object,
* the statement completes when the last row of the
* <code>ResultSet</code> object has been retrieved or the
* <code>ResultSet</code> object has been closed. In advanced cases, a
* single statement may return multiple results as well as output
* parameter values. In these cases, the commit occurs when all results and
* output parameter values have been retrieved.
* <P>
* <B>NOTE:</B> If this method is called during a transaction, the
* transaction is committed.
*
* @param autoCommit <code>true</code> to enable auto-commit mode;
* <code>false</code> to disable it
* @exception SQLException if a database access error occurs
* @see #getAutoCommit
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
this.autoCommit = autoCommit;
// throw new UnsupportedOperationException(
// "Connection.setAutoCommit(boolean) unsupported");
}
/**
* Retrieves the current auto-commit mode for this <code>Connection</code>
* object.
*
* @return the current state of this <code>Connection</code> object's
* auto-commit mode
* @exception SQLException if a database access error occurs
* @see #setAutoCommit
*/
public boolean getAutoCommit() throws SQLException {
// throw new UnsupportedOperationException(
// "Connection.getAutoCommit() unsupported");
// return true;
return this.autoCommit;
}
/**
* Makes all changes made since the previous
* commit/rollback permanent and releases any database locks
* currently held by this <code>Connection</code> object.
* This method should be
* used only when auto-commit mode has been disabled.
*
* @exception SQLException if a database access error occurs or this
* <code>Connection</code> object is in auto-commit mode
* @see #setAutoCommit
*/
public void commit() throws SQLException {
for (int i = 0; i < this.statements.size(); i++) {
( (Statement) statements.get(i)).close();
}
}
/**
* Undoes all changes made in the current transaction
* and releases any database locks currently held
* by this <code>Connection</code> object. This method should be
* used only when auto-commit mode has been disabled.
*
* @exception SQLException if a database access error occurs or this
* <code>Connection</code> object is in auto-commit mode
* @see #setAutoCommit
*/
public void rollback() throws SQLException {
throw new UnsupportedOperationException(
"Connection.rollback() unsupported");
}
/**
* Releases this <code>Connection</code> object's database and JDBC
* resources immediately instead of waiting for them to be automatically
* released.
* <P>
* Calling the method <code>close</code> on a <code>Connection</code>
* object that is already closed is a no-op.
* <P>
* <B>Note:</B> A <code>Connection</code> object is automatically
* closed when it is garbage collected. Certain fatal errors also
* close a <code>Connection</code> object.
*
* @exception SQLException if a database access error occurs
*/
public void close() throws SQLException {
// close all created statements
for (Enumeration i = statements.elements(); i.hasMoreElements(); ) {
Statement statement = (Statement) i.nextElement();
statement.close();
}
// set this Connection as closed
closed = true;
}
/**
* Retrieves whether this <code>Connection</code> object has been
* closed. A connection is closed if the method <code>close</code>
* has been called on it or if certain fatal errors have occurred.
* This method is guaranteed to return <code>true</code> only when
* it is called after the method <code>Connection.close</code> has
* been called.
* <P>
* This method generally cannot be called to determine whether a
* connection to a database is valid or invalid. A typical client
* can determine that a connection is invalid by catching any
* exceptions that might be thrown when an operation is attempted.
*
* @return <code>true</code> if this <code>Connection</code> object
* is closed; <code>false</code> if it is still open
* @exception SQLException if a database access error occurs
*/
public boolean isClosed() throws SQLException {
return closed;
}
/**
* Retrieves a <code>DatabaseMetaData</code> object that contains
* metadata about the database to which this
* <code>Connection</code> object represents a connection.
* The metadata includes information about the database's
* tables, its supported SQL grammar, its stored
* procedures, the capabilities of this connection, and so on.
*
* @return a <code>DatabaseMetaData</code> object for this
* <code>Connection</code> object
* @exception SQLException if a database access error occurs
*/
public DatabaseMetaData getMetaData() throws SQLException {
throw new UnsupportedOperationException(
"Connection.getMetaData() unsupported");
}
/**
* Puts this connection in read-only mode as a hint to the driver to enable
* database optimizations.
*
* <P><B>Note:</B> This method cannot be called during a transaction.
*
* @param readOnly <code>true</code> enables read-only mode;
* <code>false</code> disables it
* @exception SQLException if a database access error occurs or this
* method is called during a transaction
*/
public void setReadOnly(boolean readOnly) throws SQLException {
throw new UnsupportedOperationException(
"Connection.setReadOnly(boolean) unsupported");
}
/**
* Retrieves whether this <code>Connection</code>
* object is in read-only mode.
*
* @return <code>true</code> if this <code>Connection</code> object
* is read-only; <code>false</code> otherwise
* @exception SQLException if a database access error occurs
*/
public boolean isReadOnly() throws SQLException {
return true;
}
/**
* Sets the given catalog name in order to select
* a subspace of this <code>Connection</code> object's database
* in which to work.
* <P>
* If the driver does not support catalogs, it will
* silently ignore this request.
*
* @param catalog the name of a catalog (subspace in this
* <code>Connection</code> object's database) in which to work
* @exception SQLException if a database access error occurs
* @see #getCatalog
*/
public void setCatalog(String catalog) throws SQLException {
// silently ignore this request
}
/**
* Retrieves this <code>Connection</code> object's current catalog name.
*
* @return the current catalog name or <code>null</code> if there is none
* @exception SQLException if a database access error occurs
* @see #setCatalog
*/
public String getCatalog() throws SQLException {
return null;
}
/**
* Attempts to change the transaction isolation level for this
* <code>Connection</code> object to the one given.
* The constants defined in the interface <code>Connection</code>
* are the possible transaction isolation levels.
* <P>
* <B>Note:</B> If this method is called during a transaction, the result
* is implementation-defined.
*
* @param level one of the following <code>Connection</code> constants:
* <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
* <code>Connection.TRANSACTION_READ_COMMITTED</code>,
* <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or
* <code>Connection.TRANSACTION_SERIALIZABLE</code>.
* (Note that <code>Connection.TRANSACTION_NONE</code> cannot be used
* because it specifies that transactions are not supported.)
* @exception SQLException if a database access error occurs
* or the given parameter is not one of the <code>Connection</code>
* constants
* @see DatabaseMetaData#supportsTransactionIsolationLevel
* @see #getTransactionIsolation
*/
public void setTransactionIsolation(int level) throws SQLException {
throw new UnsupportedOperationException(
"Connection.setTransactionIsolation(int) unsupported");
}
/**
* Retrieves this <code>Connection</code> object's current
* transaction isolation level.
*
* @return the current transaction isolation level, which will be one
* of the following constants:
* <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
* <code>Connection.TRANSACTION_READ_COMMITTED</code>,
* <code>Connection.TRANSACTION_REPEATABLE_READ</code>,
* <code>Connection.TRANSACTION_SERIALIZABLE</code>, or
* <code>Connection.TRANSACTION_NONE</code>.
* @exception SQLException if a database access error occurs
* @see #setTransactionIsolation
*/
public int getTransactionIsolation() throws SQLException {
return Connection.TRANSACTION_NONE;
}
/**
* Retrieves the first warning reported by calls on this
* <code>Connection</code> object. If there is more than one
* warning, subsequent warnings will be chained to the first one
* and can be retrieved by calling the method
* <code>SQLWarning.getNextWarning</code> on the warning
* that was retrieved previously.
* <P>
* This method may not be
* called on a closed connection; doing so will cause an
* <code>SQLException</code> to be thrown.
*
* <P><B>Note:</B> Subsequent warnings will be chained to this
* SQLWarning.
*
* @return the first <code>SQLWarning</code> object or <code>null</code>
* if there are none
* @exception SQLException if a database access error occurs or
* this method is called on a closed connection
* @see SQLWarning
*/
public SQLWarning getWarnings() throws SQLException {
throw new UnsupportedOperationException(
"Connection.getWarnings() unsupported");
}
/**
* Clears all warnings reported for this <code>Connection</code> object.
* After a call to this method, the method <code>getWarnings</code>
* returns <code>null</code> until a new warning is
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -