com.mckoi.database.jdbc |
com.mckoi.database.jdbc - JDBC interface to Mckoi
The JDBC interface to Mckoi.
Establishing a Connection
An application establishes a JDBC Connection by calling
java.sql.DriverManager.getConnection(String url, Properties info).
DriverManager.getConnection calls java.sql.Driver.connect, which
figures out that the URL is a Mckoi URL,
so calls
com.mckoi.database.jdbc.MDriver,
which was registered by a static initializer in
com.mckoi.JDBCDriver.
If the URL is local (embedded mode), MDriver creates an instance of
com.mckoi.database.jdbcserver.LocalDatabaseInterface,
which in turns creates and wraps up an instance of
com.mckoi.database.jdbcserver.JDBCDatabaseInterface,
and calls its
connectToJVM method to initialize it.
If the URL is remote (client/server mode), MDriver creates an instance of
TCPStreamDatabaseInterface
and calls its
connectToDatabase
method in order to establish a TCP connection to the
Mckoi database server.
For more information on how the server handles connections, see the package
com.mckoi.database.jdbcserver.
In either case, the resulting
DatabaseInterface
is wrapped up in a
MConnection,
and returned to the application as an instance of java.sql.Connection.
Executing a Query
When an application calls java.sql.Connection.createStatement() on its
MConnection, it gets back an instance of
MStatement,
which carries a pointer to the MConnection.
When the application calls java.sql.Statement.executeQuery(String) on
its MStatement, Mckoi creates an SQLQuery
from the String, creates an empty
MResultSet, then calls
MStatement.executeQuery
with those two objects.
MStatement.executeQuery turns around and calls
Mconnection.executeQuery,
which calls
execQuery on its
DatabaseInterface.
Depending on whether the connection is local or remote,
this call is either to
com.mckoi.database.jdbcserver.LocalDatabaseInterface.execQuery
for local connections, or to
RemoteDatabaseInterface.execQuery
for remote connections.
These are described more fully in the package description for
com.mckoi.database.jdbcserver
under
Local Queries
and
Remote Queries.
|
Java Source File Name | Type | Comment |
AbstractStreamableObject.java | Class | An abstract class that provides various convenience behaviour for
creating streamable java.sql.Blob and java.sql.Clob classes. |
AsciiInputStream.java | Class | An InputStream that converts a Reader to a plain ascii stream. |
AsciiReader.java | Class | A java.io.Reader implementation that wraps around an ascii input stream
(8-bit per char stream). |
BinaryToUnicodeReader.java | Class | A Reader implementation that wraps around a unicode encoded input stream
that encodes each unicode character as 2 bytes. |
DatabaseCallBack.java | Interface | An interface that is input to the DatabaseInterface as a way to be
notified of event information from inside the database. |
DatabaseInterface.java | Interface | The interface with the Database whether it be remotely via TCP/IP or
locally within the current JVM. |
LocalBootable.java | Interface | An interface that is implemented by an object that boots up the database. |
MBlob.java | Class | An implementation of an sql.Blob object. |
MckoiConnection.java | Class | Wraps a Connection and provides Mckoi specific extensions that are
outside the JDBC specification.
Example,
Connection connection = java.sql.DriverManager.getConnection( .... |
MClob.java | Class | An implementation of java.sql.Clob over a java.util.String object. |
MConnection.java | Class | JDBC implementation of the connection object to a Mckoi database. |
MDatabaseMetaData.java | Class | An implementation of JDBC's DatabaseMetaData. |
MDriver.java | Class | JDBC implementation of the driver for the Mckoi database.
The url protocol is as follows:
For connecting to a remote database server:
jdbc:mckoi:[//hostname[:portnum]/][schema_name/]
eg. |
MPreparedStatement.java | Class | An implementation of a JDBC prepared statement.
Multi-threaded issue: This class is not designed to be multi-thread
safe. |
MResultSet.java | Class | Implementation of a ResultSet.
Multi-threaded issue: This class is not designed to be multi-thread
safe. |
MResultSetMetaData.java | Class | An implementation of JDBC's ResultSetmetaData. |
MSQLException.java | Class | SQLException used by the McKoi database engine. |
MStatement.java | Class | An implementation of JDBC Statement.
Multi-threaded issue: This class is not designed to be multi-thread
safe. |
MStreamableBlob.java | Class | A Blob that is a large object that may be streamed from the server directly
to this object. |
MStreamableClob.java | Class | A Clob that is a large object that may be streamed from the server directly
to this object. |
ProtocolConstants.java | Interface | Constants used in the JDBC database communication protocol. |
QueryResponse.java | Interface | The response to a query executed via the 'execQuery' method in the
DatabaseInterface interface. |
RemoteDatabaseInterface.java | Class | An abstract implementation of DatabaseInterface that retrieves information
from a remote server host. |
ResultPart.java | Class | A container class that holds a part of a result set. |
RowCache.java | Class | A Cache that stores rows retrieved from the server in result set's. |
SQLLoginException.java | Class | An SQLException that signifies username/password authentication failed. |
SQLQuery.java | Class | Represents an SQL Query to the database. |
StreamableObjectPart.java | Class | Represents a response from the server for a section of a streamable object. |
StreamDatabaseInterface.java | Class | An stream implementation of an interface to a McKoi database. |
TCPStreamDatabaseInterface.java | Class | Connection to the database via the TCP protocol. |
TriggerListener.java | Interface | A listener that is notified when the trigger being listened to is fired. |
UnicodeToBinaryStream.java | Class | An object that wraps around a Reader and translates the unicode stream into
a stream of bytes that the database is able to transfer to the database.
This object simply converts each char from the Reader into two bytes. |