All Packages Class Hierarchy This Package Previous Next Index
Class com.imaginary.sql.msql.MsqlConnection
com.imaginary.sql.msql.MsqlConnection
- public class MsqlConnection
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/07/09 23:16:25 $
- Version:
- $Revision: 1.1.2.1.2.2 $
- Author:
- George Reese (borg@imaginary.com)
- See Also:
- getConnection
-
database
-
-
input
-
-
output
-
-
url
-
-
user
-
-
version
-
-
versionString
-
-
clearWarnings()
- Since mSQL produces no warnings, this is a NO-OP
-
close()
- Closes this database connection.
-
commit()
- This is a NO-OP for mSQL.
-
createStatement()
- This JDBC method creates an instance of MsqlStatement that is
forward-only and read-only.
-
getAutoCommit()
- This method always returns true since mSQL is always in auto-commit
mode.
-
getCatalog()
- Provides the catalog name.
-
getEncoding()
-
-
getMetaData()
- Provides meta-data for the database connection.
-
getTransactionIsolation()
-
-
getUser()
-
-
getWarnings()
- mSQL does not have warnings.
-
isClosed()
-
-
isReadOnly()
- mSQL does not support read only connections, only read-only access
rights.
-
nativeSQL(String)
- This gives the driver an opportunity to turn JDBC compliant SQL
into mSQL specific SQL.
-
prepareCall(String)
- Callable statements are not supported by mSQL.
-
prepareStatement(String)
- Constructs a PreparedStatement matching the specified statement.
-
rollback()
- This method always errors since you cannot rollback an mSQL
transaction.
-
setAutoCommit(boolean)
- This method will thrown an exception if you try to turn auto-commit
off since JDBC does not support transactional logic.
-
setCatalog(String)
- Selects the database to be used by this connection.
-
setReadOnly(boolean)
- mSQL does not support read-only mode.
-
setTransactionIsolation(int)
- This is not supported by mSQL, thus this is a NO-OP.
database
protected String database
input
protected MsqlInputStream input
output
protected MsqlOutputStream output
url
protected String url
user
protected String user
version
protected int version
versionString
protected String versionString
clearWarnings
public void clearWarnings() throws SQLException
- Since mSQL produces no warnings, this is a NO-OP
- Throws: SQLException
- this is never thrown
close
public synchronized void close() throws SQLException
- Closes this database connection. It will also close any associated
Statement instances.
- Throws: SQLException
- thrown if problems occur
commit
public void commit() throws SQLException
- This is a NO-OP for mSQL. All statements are always auto-committed.
- Throws: SQLException
- this is never thrown
createStatement
public synchronized Statement createStatement() throws SQLException
- This JDBC method creates an instance of MsqlStatement that is
forward-only and read-only. Note 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
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
getCatalog
public String getCatalog() throws SQLException
- Provides the catalog name. For mSQL, this is the database to
which you are connected.
- Returns:
- always null
- Throws: SQLException
- never thrown
getEncoding
public String getEncoding()
- Returns:
- the encoding for the application
getMetaData
public DatabaseMetaData getMetaData() throws SQLException
- Provides meta-data for the database connection.
- Returns:
- the mSQL implementation of DatabaseMetaData
- Throws: SQLException
- this is never thrown
getTransactionIsolation
public int getTransactionIsolation() throws SQLException
- Returns:
- the transaction isolation, always Connection.TRANSACTION_NONE
- Throws: SQLException
- this is never thrown
getUser
public synchronized String getUser() throws SQLException
- Returns:
- the user name used for this Connection
- Throws: SQLException
- this is never thrown
getWarnings
public SQLWarning getWarnings() throws SQLException
- mSQL does not have warnings.
- Returns:
- always null
- Throws: SQLException
- this is never thrown
isClosed
public synchronized boolean isClosed()
- Returns:
- true if this Connection has been closed
isReadOnly
public boolean isReadOnly() throws SQLException
- mSQL does not support read only connections, only read-only access
rights.
- Returns:
- false--always
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
prepareCall
public CallableStatement prepareCall(String unused) throws SQLException
- Callable statements are not supported by mSQL. This will therefore
always throw an exception.
- Parameters:
- unused - the name of the stored procedure
- Returns:
- nothing, it always throws an exception
- Throws: SQLException
- this will always be thrown
prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException
- Constructs a PreparedStatement matching the specified statement.
Note that mSQL does not natively support prepared statements, so
mSQL-JDBC prepared statement support is a bit faked. In other words,
there is absolutely no performance benedit to using prepared
statements with mSQL.
- Parameters:
- sql - the prepared statement
- Returns:
- a new PreparedStatement matching the specified SQL
- Throws: SQLException
- the Connection was unable to create
a PreparedStatement for the specified SQL
rollback
public void rollback() throws SQLException
- This method always errors since you cannot rollback an mSQL
transaction.
- Throws: SQLException
- this will always get thrown by this
method
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
setCatalog
public synchronized void setCatalog(String db) throws SQLException
- Selects the database to be used by this connection.
- Parameters:
- db - the name of the mSQL database
- Throws: SQLException
- failed to set the new database
setReadOnly
public void setReadOnly(boolean b) throws SQLException
- mSQL does not support read-only mode.
- Parameters:
- b - should only ever be false
- Throws: SQLException
- this is thrown if an attempt is made
to put the driver in read-only mode
setTransactionIsolation
public void setTransactionIsolation(int unused) throws SQLException
- This is not supported by mSQL, thus this is a NO-OP. The
transaction isolation level is always set to
Connection.TRANSACTION_NONE.
- Parameters:
- unused - the transaction isolation level
- Throws: SQLException
- this is never thrown
- See Also:
- TRANSACTION_NONE
All Packages Class Hierarchy This Package Previous Next Index