public interface DatabaseInterface
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Called when the connection is disposed.
|
void |
disposeResult(int result_id)
Disposes of a result of a query on the server.
|
void |
disposeStreamableObject(int result_id,
long streamable_object_id)
Disposes a streamable object channel with the given identifier.
|
QueryResponse |
execQuery(SQLQuery sql)
Executes the query and returns a QueryResponse object that describes the
result of the query.
|
ResultPart |
getResultPart(int result_id,
int row_number,
int row_count)
Returns a part of a result set.
|
StreamableObjectPart |
getStreamableObjectPart(int result_id,
long streamable_object_id,
long offset,
int len)
Returns a section of a large binary or character stream in a result set.
|
boolean |
login(String default_schema,
String username,
String password,
DatabaseCallBack call_back)
Attempts to log in to the database as the given username with the given
password.
|
void |
pushStreamableObjectPart(byte type,
long object_id,
long object_length,
byte[] buf,
long offset,
int length)
Pushes a part of a streamable object from the client onto the server.
|
boolean login(String default_schema, String username, String password, DatabaseCallBack call_back) throws SQLException
A DatabaseCallBack implementation must be given here that is notified of all events from the database. Events are only received if the login was successful.
SQLException
void pushStreamableObjectPart(byte type, long object_id, long object_length, byte[] buf, long offset, int length) throws SQLException
1) Push 100 MB object (id = 104) 2) execQuery with query that contains a streamable object with id 104
Note that the client may push any part of a streamable object onto the server, however the streamable object must have been completely pushed for the query to execute correctly. For example, an 100 MB byte array may be pushed onto the server in blocks of 64K (in 1,600 separate blocks).
type
- the StreamableObject type (1 = byte array, 2 = char array)object_id
- the identifier of the StreamableObject for future queries.object_length
- the total length of the StreamableObject.buf
- the byte[] array representing the block of information being
sent.offset
- the offset into of the object of this block.length
- the length of the block being pushed.SQLException
QueryResponse execQuery(SQLQuery sql) throws SQLException
SQLException
ResultPart getResultPart(int result_id, int row_number, int row_count) throws SQLException
The returned List object contains the result requested.
If the result contains any StreamableObject objects, then the server allocates a channel to the object via the 'getStreamableObjectPart' and the identifier of the StreamableObject. The channel may only be disposed if the 'disposeStreamableObject' method is called.
SQLException
void disposeResult(int result_id) throws SQLException
SQLException
StreamableObjectPart getStreamableObjectPart(int result_id, long streamable_object_id, long offset, int len) throws SQLException
SQLException
void disposeStreamableObject(int result_id, long streamable_object_id) throws SQLException
SQLException
void dispose() throws SQLException
SQLException
Copyright © 2015. All rights reserved.