All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.imaginary.sql.msql.MsqlConnection

java.lang.Object
   |
   +----com.imaginary.sql.msql.MsqlConnection

public class MsqlConnection
extends Object
implements Connection
The MsqlConnection class is an implementation of the JDBC Connection interface that represents a database transaction. This class should never be directly instantiated by an application, but instead should be gotten by calling DriverManager.getConnection().
Last modified $Date: 1999/01/22 05:33:41 $

Version:
$Revision: 1.1.2.1.2.1 $
Author:
George Reese (borg@imaginary.com)
See Also:
getConnection

Method Index

 o clearWarnings()
Sets the SQLWarning chain to null.
 o close()
Closes this database connection.
 o commit()
This is a NO-OP for mSQL.
 o createStatement()
This JDBC method creates an instance of MsqlStatement and returns it.
 o getAutoCommit()
This method always returns true since mSQL is always in auto-commit mode.
 o getCatalog()
Provides the catalog name.
 o getMetaData()
This method is not yet implemented.
 o getTransactionIsolation()
 o getUser()
 o getWarnings()
 o isClosed()
 o isReadOnly()
 o nativeSQL(String)
This gives the driver an opportunity to turn JDBC compliant SQL into mSQL specific SQL.
 o prepareCall(String)
Callable statements are not supported by mSQL.
 o prepareStatement(String)
Constructs a prepared statement.
 o rollback()
This method always errors since you cannot rollback an mSQL transaction.
 o setAutoCommit(boolean)
This method will thrown an exception if you try to turn auto-commit off since JDBC does not support transactional logic.
 o setCatalog(String)
Sets the catalog name for this connection.
 o setReadOnly(boolean)
mSQL does not support read-only mode.
 o setTransactionIsolation(int)
This is not supported by mSQL, thus this is a NO-OP.

Methods

 o isClosed
 public synchronized boolean isClosed() throws SQLException
Returns:
true if this Connection has been closed
Throws: SQLException
never thrown
 o isReadOnly
 public boolean isReadOnly() throws SQLException
Returns:
false--always
 o getAutoCommit
 public boolean getAutoCommit() throws SQLException
This method always returns true since mSQL is always in auto-commit mode.

Returns:
true--always
Throws: SQLException
never thrown
 o setAutoCommit
 public void setAutoCommit(boolean b) throws SQLException
This method will thrown an exception if you try to turn auto-commit off since JDBC does not support transactional logic.

Parameters:
b - should always be true
Throws: SQLException
thrown if the param is false
 o getCatalog
 public synchronized String getCatalog() throws SQLException
Provides the catalog name. mSQL does not support catalogs, however.

Throws: SQLException
never thrown
 o setCatalog
 public synchronized void setCatalog(String str) throws SQLException
Sets the catalog name for this connection. mSQL does not support catalogs, so this method is a NO-OP.

Throws: SQLException
never thrown
 o getMetaData
 public DatabaseMetaData getMetaData() throws SQLException
This method is not yet implemented.

 o setReadOnly
 public void setReadOnly(boolean b) throws SQLException
mSQL does not support read-only mode.

Throws: SQLException
alway thrown
 o getTransactionIsolation
 public synchronized int getTransactionIsolation() throws SQLException
Returns:
the transaction isolation, not supported by mSQL
Throws: SQLException
never thrown
 o setTransactionIsolation
 public synchronized void setTransactionIsolation(int x) throws SQLException
This is not supported by mSQL, thus this is a NO-OP.

Throws: SQLException
never thrown
 o getUser
 public String getUser() throws SQLException
Returns:
the user name used for this Connection
Throws: SQLException
thrown if the connection is never made
 o getWarnings
 public synchronized SQLWarning getWarnings() throws SQLException
Returns:
the SQLWarning chain for this Connection
Throws: SQLException
never thrown
 o clearWarnings
 public synchronized void clearWarnings() throws SQLException
Sets the SQLWarning chain to null.

Throws: SQLException
never thrown
 o close
 public synchronized void close() throws SQLException
Closes this database connection. It will also close any associated Statement instance.

Throws: SQLException
thrown if problems occur
 o commit
 public void commit() throws SQLException
This is a NO-OP for mSQL. All statements are always auto-committed.

Throws: SQLException
never thrown
 o createStatement
 public Statement createStatement() throws SQLException
This JDBC method creates an instance of MsqlStatement and returns it. If there are currently any open MsqlStatement's, it will close them. Not that mSQL does not provide a way to interrupt executing statements, so it has to wait for any pending statements to finish before closing them.

Returns:
a new MsqlStatement instance
Throws: SQLException
an error occurred in creating the Statement instance, likely raised by the constructor
 o nativeSQL
 public String nativeSQL(String sql) throws SQLException
This gives the driver an opportunity to turn JDBC compliant SQL into mSQL specific SQL. My feeling is why bother.

Throws: SQLException
never thrown
 o prepareCall
 public CallableStatement prepareCall(String sql) throws SQLException
Callable statements are not supported by mSQL. This will therefore always throw an exception.

 o prepareStatement
 public PreparedStatement prepareStatement(String sql) throws SQLException
Constructs a prepared statement.

Parameters:
sql - the prepared SQL
Returns:
a prepared statement.
Throws: SQLException
a database error occurred
 o rollback
 public void rollback() throws SQLException
This method always errors since you cannot rollback an mSQL transaction.


All Packages  Class Hierarchy  This Package  Previous  Next  Index