|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavacli.Connection
Gigabase interface responsible for managing connection with GigaBASE server. Also it implements insert commit, rollback operations
Field Summary | |
static int |
cli_already_updated
|
static int |
cli_bad_address
|
static int |
cli_bad_statement
|
static int |
cli_closed_connection
|
static int |
cli_closed_statement
|
static int |
cli_column_not_found
|
static int |
cli_connection_refused
|
static int |
cli_database_not_found
|
static int |
cli_empty_parameter
|
static int |
cli_incompatible_type
|
static int |
cli_login_failed
|
static int |
cli_network_error
|
static int |
cli_not_all_columns_specified
|
static int |
cli_not_fetched
|
static int |
cli_not_found
|
static int |
cli_not_implemented
|
static int |
cli_not_update_mode
|
static int |
cli_ok
|
static int |
cli_parameter_not_found
|
static int |
cli_runtime_error
|
static int |
cli_table_already_exists
|
static int |
cli_table_not_found
|
static int |
cli_unbound_parameter
|
static int |
cli_unsupported_type
|
Constructor Summary | |
Connection()
|
Method Summary | |
void |
addIndex(java.lang.String tableName,
java.lang.String fieldName)
Add case sensitive index |
void |
addIndex(java.lang.String tableName,
java.lang.String fieldName,
boolean caseInsensitive)
Add index |
void |
addPackage(java.lang.String pkName)
Add package name to the list of registered package. |
void |
close()
Close connection with server |
void |
commit()
Commit current transaction |
Statement |
createStatement(java.lang.String sql)
Create select statement. |
boolean |
createTable(java.lang.Class cls)
Create table matching specified class. |
boolean |
createTable(java.lang.Class cls,
java.util.HashMap referenceMap)
Create table matching specified class. |
void |
dropIndex(java.lang.String tableName,
java.lang.String fieldName)
Drop index |
void |
dropTable(java.lang.Class cls)
Drop table corresponding to the specified class. |
void |
dropTable(java.lang.String tableName)
Drop specified table |
Reference |
insert(java.lang.Object obj)
Insert object in the database. |
void |
open(java.lang.String hostAddress,
int hostPort)
Open onnection with server |
void |
open(java.lang.String hostAddress,
int hostPort,
java.lang.String userName,
java.lang.String userPassword)
Open connection with server |
void |
precommit()
Release all locks set by the current transaction |
void |
rollback()
Rollback curent transaction.Al changes made by current transaction are lost. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int cli_ok
public static final int cli_bad_address
public static final int cli_connection_refused
public static final int cli_database_not_found
public static final int cli_bad_statement
public static final int cli_parameter_not_found
public static final int cli_unbound_parameter
public static final int cli_column_not_found
public static final int cli_incompatible_type
public static final int cli_network_error
public static final int cli_runtime_error
public static final int cli_closed_statement
public static final int cli_unsupported_type
public static final int cli_not_found
public static final int cli_not_update_mode
public static final int cli_table_not_found
public static final int cli_not_all_columns_specified
public static final int cli_not_fetched
public static final int cli_already_updated
public static final int cli_table_already_exists
public static final int cli_not_implemented
public static final int cli_login_failed
public static final int cli_empty_parameter
public static final int cli_closed_connection
Constructor Detail |
public Connection()
Method Detail |
public void open(java.lang.String hostAddress, int hostPort)
hostAddress
- string with server host namehostPort
- integer number with server portpublic void open(java.lang.String hostAddress, int hostPort, java.lang.String userName, java.lang.String userPassword)
hostAddress
- string with server host namehostPort
- integer number with server portuserName
- user nameuserPassword
- passwordpublic void addPackage(java.lang.String pkName)
pkName
- - name of the packagepublic void close()
public Statement createStatement(java.lang.String sql)
sql
- - SubSQL select statement with parameters. Paameters should be
started with %
character. Each used paramter should be set
before execution of the statement.public void commit()
public void precommit()
public void rollback()
public Reference insert(java.lang.Object obj)
java.lang.String
, arrays of primitive types or strings, java.util.Date
are supported by GigaBASE. If int
field is marked as volatile
, it
is assumed to be autoincremented field - unique value to this field is assigned automatically
by GigaBASE.
obj
- - object to be inserted inthe database
public boolean createTable(java.lang.Class cls)
cls
- Java class for which table should be created.
true
if table sucessfully created, false
if table already exists
throws
- CliError exception in case of all other errors (except table already exists)public boolean createTable(java.lang.Class cls, java.util.HashMap referenceMap)
cls
- Java class for which table should be created.referenceMap
- map to provide names of referenced tables for reference fields.
Key of this map is field name.
true
if table sucessfully created, false
if table already exists
throws
- CliError exception in case of all other errors (except table already exists)public void dropTable(java.lang.Class cls)
cls
- Java class for which should be created. Name of the table is the same
as name of the class without any package prefixes.public void dropTable(java.lang.String tableName)
tableName
- name of the tablepublic void addIndex(java.lang.String tableName, java.lang.String fieldName)
tableName
- name of the tablefieldName
- name of the fieldpublic void addIndex(java.lang.String tableName, java.lang.String fieldName, boolean caseInsensitive)
tableName
- name of the tablefieldName
- name of the fieldcaseInsensitive
- attribute specifying whether index is case insensitive or notpublic void dropIndex(java.lang.String tableName, java.lang.String fieldName)
tableName
- name of the tablefieldName
- name of the field
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |