public final class EmbeddedConnection
extends nl.cwi.monetdb.jdbc.MonetConnection
Connection
suitable for the MonetDB database using an embedded connection.conn_props, hash, language, protocol
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
Constructor and Description |
---|
EmbeddedConnection(Properties props,
String hash,
String language,
String directory) |
Modifier and Type | Method and Description |
---|---|
void |
closeUnderlyingConnection()
Closes the underlying connection implementation.
|
List<String> |
connect(String user,
String pass)
Connects to the existing database on the JVM process.
|
protected boolean |
executeNextQueryBatch(nl.cwi.monetdb.jdbc.MonetStatement statement,
List<String> batch,
int[] counts,
BatchUpdateException e)
Execute a batch query in an embedded connection.
|
MonetDBEmbeddedConnection |
getAsMonetDBEmbeddedConnection()
Makes a conversion of this connection as a
MonetDBEmbeddedConnection instance, making it possible to
access the MonetDBEmbeddedConnection API on a JDBC embedded connection, although that API doesn't follow
the JDBC specification. |
int |
getBlockSize()
Gets the underlying connection block size length.
|
int |
getDefFetchsize()
Gets the underlying connection default fetch size for DataBlock responses.
|
String |
getDirectory()
Gets the directory where the database is hosted.
|
String |
getJDBCURL()
Gets the underlying connection JDBC String URL.
|
int |
getSoTimeout()
In a embedded connection there is no timeout, so this methods always adds a
SQLWarning and returns -1. |
int |
initialStringBuilderSize() |
boolean |
isRunningInMemory()
Is the connection running in memory?
|
void |
sendControlCommand(int commandID,
int data)
Sends a control command to the server.
|
void |
setSoTimeout(int timeout)
In a embedded connection there is no timeout, so this methods always adds a
SQLWarning and the timeout
parameter is ignored. |
abort, clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, finalize, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getLanguage, getMetaData, getNetworkTimeout, getProtocol, getSchema, getSeqCounter, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isEmbedded, isReadOnly, isValid, mapBlobAsVarBinary, mapClobAsVarChar, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, toString
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
isWrapperFor, unwrap
public EmbeddedConnection(Properties props, String hash, String language, String directory)
public String getDirectory()
public boolean isRunningInMemory()
public MonetDBEmbeddedConnection getAsMonetDBEmbeddedConnection()
MonetDBEmbeddedConnection
instance, making it possible to
access the MonetDBEmbeddedConnection
API on a JDBC embedded connection, although that API doesn't follow
the JDBC specification.MonetDBEmbeddedConnection
instancepublic List<String> connect(String user, String pass) throws IOException, nl.cwi.monetdb.mcl.protocol.ProtocolException, nl.cwi.monetdb.mcl.connection.MCLException
MCLException
will be thrown.
connect
in class nl.cwi.monetdb.jdbc.MonetConnection
user
- The user name to authenticate (ignored)pass
- The user's password (ignored)nl.cwi.monetdb.mcl.connection.MCLException
- If the database is already running in a different directoryIOException
nl.cwi.monetdb.mcl.protocol.ProtocolException
public String getJDBCURL()
getJDBCURL
in class nl.cwi.monetdb.jdbc.MonetConnection
public int getBlockSize()
getBlockSize
in class nl.cwi.monetdb.jdbc.MonetConnection
public int getDefFetchsize()
getDefFetchsize
in class nl.cwi.monetdb.jdbc.MonetConnection
public int initialStringBuilderSize()
initialStringBuilderSize
in class nl.cwi.monetdb.jdbc.MonetConnection
public int getSoTimeout() throws SocketException
SQLWarning
and returns -1.getSoTimeout
in class nl.cwi.monetdb.jdbc.MonetConnection
SocketException
public void setSoTimeout(int timeout) throws SocketException
SQLWarning
and the timeout
parameter is ignored.setSoTimeout
in class nl.cwi.monetdb.jdbc.MonetConnection
timeout
- The specified timeout, in milliseconds (ignored)SocketException
public void closeUnderlyingConnection() throws IOException
closeUnderlyingConnection
in class nl.cwi.monetdb.jdbc.MonetConnection
IOException
- if an error happens while closing the connection or the databasepublic void sendControlCommand(int commandID, int data) throws SQLException
sendControlCommand
in class nl.cwi.monetdb.jdbc.MonetConnection
commandID
- the command identifier according to ControlCommands
listingdata
- The integer to send according to the control commandSQLException
- if an IO exception or a database error occursprotected boolean executeNextQueryBatch(nl.cwi.monetdb.jdbc.MonetStatement statement, List<String> batch, int[] counts, BatchUpdateException e) throws SQLException
executeNextQueryBatch
in class nl.cwi.monetdb.jdbc.MonetConnection
statement
- The original MonetStatement where the batch comes frombatch
- The list of queries to executecounts
- The return of the update statement of each input querye
- An exception to be thrown if an error occursSQLException
- if an IO exception or a database error occursCopyright © 2018. All rights reserved.