| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object | +--org.gjt.mm.mysql.Connection
| Constructor Summary | |
| Connection(java.lang.String Host,
int port,
java.util.Properties Info,
java.lang.String Database,
java.lang.String Url,
Driver D)
Connect to a MySQL Server. |
|
| Method Summary | |
| void | clearWarnings()
After this call, getWarnings returns null until a new warning is reported for this connection. |
| void | close()
In some cases, it is desirable to immediately release a Connection's database and JDBC resources instead of waiting for them to be automatically released (cant think why off the top of my head) Note: A Connection is automatically closed when it is garbage collected. |
| void | commit()
The method commit() makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the Connection. |
| java.sql.Statement | createStatement()
SQL statements without parameters are normally executed using Statement objects. |
| boolean | getAutoCommit()
gets the current auto-commit state |
| java.lang.String | getCatalog()
Return the connections current catalog name, or null if no catalog name is set, or we dont support catalogs. |
| java.sql.DatabaseMetaData | getMetaData()
A connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, etc. |
| int | getTransactionIsolation()
Get this Connection's current transaction isolation mode. |
| java.sql.SQLWarning | getWarnings()
The first warning reported by calls on this Connection is returned. |
| boolean | isClosed()
Tests to see if a Connection is closed |
| boolean | isReadOnly()
Tests to see if the connection is in Read Only Mode. |
| java.lang.String | nativeSQL(java.lang.String Sql)
A driver may convert the JDBC sql grammar into its system's native SQL grammar prior to sending it; nativeSQL returns the native form of the statement that the driver would have sent. |
| java.sql.CallableStatement | prepareCall(java.lang.String sql)
A SQL stored procedure call statement is handled by creating a CallableStatement for it. |
| java.sql.PreparedStatement | prepareStatement(java.lang.String Sql)
A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. |
| void | rollback()
The method rollback() drops all changes made since the previous commit/rollback and releases any database locks currently held by the Connection. |
| void | setAutoCommit(boolean autoCommit)
If a connection is in auto-commit mode, than all its SQL statements will be executed and committed as individual transactions. |
| void | setCatalog(java.lang.String catalog)
A sub-space of this Connection's database may be selected by setting a catalog name. |
| void | setReadOnly(boolean readOnly)
You can put a connection in read-only mode as a hunt to enable database optimizations Note: setReadOnly cannot be called while in the middle of a transaction |
| void | setTransactionIsolation(int level)
You can call this method to try to change the transaction isolation level using one of the TRANSACTION_* values. |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Constructor Detail |
public Connection(java.lang.String Host,
int port,
java.util.Properties Info,
java.lang.String Database,
java.lang.String Url,
Driver D)
throws java.sql.SQLException
Important Notice
Although this will connect to the database, user code should open
the connection via the DriverManager.getConnection() methods only.
This should only be called from the postgresql.Driver class.
Host
- the hostname of the database server
port
- the port number the server is listening on
Info
- a Properties[] list holding the user and password
Database
- the database to connect to
Url
- the URL of the connection
D
- the Driver instantation of the connection| Method Detail |
public java.sql.Statement createStatement()
throws java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String Sql)
throws java.sql.SQLException
sql
- a SQL statement that may contain one or more '?' IN
parameter placeholders
public java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
sql
- a SQL statement that may contain one or more '?' parameter
placeholders. Typically this statement is a JDBC function call
escape string.
public java.lang.String nativeSQL(java.lang.String Sql)
throws java.sql.SQLException
sql
- a SQL statement that may contain one or more '?'
parameter placeholders
public void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
Note: MySQL does not support transactions, so this method is a no-op.
autoCommit
- - true enables auto-commit; false disables it
public boolean getAutoCommit()
throws java.sql.SQLException
public void commit()
throws java.sql.SQLException
Note: MySQL does not support transactions, so this method is a no-op.
public void rollback()
throws java.sql.SQLException
Note: MySQL does not support transactions, so this method is a no-op.
public void close()
throws java.sql.SQLException
public boolean isClosed()
throws java.sql.SQLException
public java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
public void setReadOnly(boolean readOnly)
throws java.sql.SQLException
readOnly
- - true enables read-only mode; false disables it
public boolean isReadOnly()
throws java.sql.SQLException
public void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
Note: MySQL does not support Catalogs
public java.lang.String getCatalog()
throws java.sql.SQLException
Note: MySQL does not support Catalogs
public void setTransactionIsolation(int level)
throws java.sql.SQLException
level
- one of the TRANSACTION_* isolation values with
the exception of TRANSACTION_NONE; some databases may
not support other values
public int getTransactionIsolation()
throws java.sql.SQLException
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
public void clearWarnings()
throws java.sql.SQLException
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||