Ontimize 5.2072EN

com.ontimize.db.sql
Interface SQLHandler

All Known Implementing Classes:
AbstractSQLHandler

public interface SQLHandler

Interface to be implemented by all database handlers. Two methods are different because they manage the parameter connection in a different mode.

Author:
Imatia Innovation

Field Summary
static java.lang.String CLOSE_PARENTHESIS
           
static java.lang.String OPEN_PARENTHESIS
           
 
Method Summary
 ISQLInfo alterSQLTable(java.util.List sqlTables, java.sql.Connection connection)
          This method alters a database table.
 ISQLInfo alterSQLTableTransactional(java.util.List sqlTables, java.sql.Connection connection)
          This method alters a database table in transactional mode.
 ISQLInfo createSQLTable(java.util.List sqlTables, java.sql.Connection connection)
          This method creates a database table.
 ISQLInfo createSQLTableTransactional(java.util.List sqlTables, java.sql.Connection connection)
          This method creates a database table in transactional mode.
 java.lang.String createStatementAlterTable(SQLTableAlter table)
          Return the SQL Statement to alter the table.
 java.lang.String createStatementCreateTable(SQLTableCreation table)
          Return the SQL Statement to create the table.
 java.lang.String createStatementDropTable(SQLTableDrop table)
          Return the SQL Statement to drop the table.
 ISQLInfo dropSQLTable(java.util.List sqlTables, java.sql.Connection connection)
          This method drops a database table.
 ISQLInfo dropSQLTableTransactional(java.util.List sqlTables, java.sql.Connection connection)
          This method drops a database table in transactional mode.
 ISQLInfo executeSQLTable(java.util.List sqlTables, java.sql.Connection connection)
          This method executes a serial of SQL actions(create,drop or alter) over a database table.
 ISQLInfo executeSQLTableTransactional(java.util.List sqlTables, java.sql.Connection connection)
          This method executes a serial of SQL actions(create,drop or alter) over a database table in transactional mode.
 java.lang.String getSQLTypeName(int sqlType)
           
 

Field Detail

OPEN_PARENTHESIS

public static final java.lang.String OPEN_PARENTHESIS
See Also:
Constant Field Values

CLOSE_PARENTHESIS

public static final java.lang.String CLOSE_PARENTHESIS
See Also:
Constant Field Values
Method Detail

createStatementCreateTable

public java.lang.String createStatementCreateTable(SQLTableCreation table)
                                            throws java.lang.Exception
Return the SQL Statement to create the table.

Parameters:
table - The SQLTableCreation table with whole information to create it.
Returns:
a String with the SQL statement
Throws:
java.lang.Exception

createStatementDropTable

public java.lang.String createStatementDropTable(SQLTableDrop table)
                                          throws java.lang.Exception
Return the SQL Statement to drop the table.

Parameters:
table - The SQLTableDrop table with whole information to drop it.
Returns:
a String with the SQL statement
Throws:
java.lang.Exception

createStatementAlterTable

public java.lang.String createStatementAlterTable(SQLTableAlter table)
                                           throws java.lang.Exception
Return the SQL Statement to alter the table.

Parameters:
table - The SQLTableAlter table with whole information to alter it.
Returns:
a String with the SQL statement
Throws:
java.lang.Exception

createSQLTable

public ISQLInfo createSQLTable(java.util.List sqlTables,
                               java.sql.Connection connection)
This method creates a database table. At first, autocommit mode in connection is fixed to false, then its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. Moreover, Exceptions are also managed by this method.

Call diagram of this method:

-connection.setAutoCommit(false);
...
...
-createSQLTableTransactional
...
...
-connection.setAutoCommit(true);

Parameters:
sqlTables - list with all sqlTables
connection - the connection

dropSQLTable

public ISQLInfo dropSQLTable(java.util.List sqlTables,
                             java.sql.Connection connection)
This method drops a database table. At first, autocommit mode in connection is fixed to false, then its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. Moreover, Exceptions are also managed by this method.

Call diagram of this method:

-connection.setAutoCommit(false);
...
...
-dropSQLTableTransactional
...
...
-connection.setAutoCommit(true);

Parameters:
sqlTables - list with all sqlTables
connection - the connection

alterSQLTable

public ISQLInfo alterSQLTable(java.util.List sqlTables,
                              java.sql.Connection connection)
This method alters a database table. At first, autocommit mode in connection is fixed to false, then its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. Moreover, Exceptions are also managed by this method.

Call diagram of this method:

-connection.setAutoCommit(false);
...
...
-alterSQLTableTransactional
...
...
-connection.setAutoCommit(true);

Parameters:
sqlTables - list with all sqlTables
connection - the connection

createSQLTableTransactional

public ISQLInfo createSQLTableTransactional(java.util.List sqlTables,
                                            java.sql.Connection connection)
                                     throws java.lang.Exception
This method creates a database table in transactional mode.

Call diagram of this method:

-execute sql to create all tables

Parameters:
sqlTables - list with all sqlTables
connection - the connection
Throws:
java.lang.Exception

dropSQLTableTransactional

public ISQLInfo dropSQLTableTransactional(java.util.List sqlTables,
                                          java.sql.Connection connection)
                                   throws java.lang.Exception
This method drops a database table in transactional mode.

Call diagram of this method:

-execute sql to drop all tables

Parameters:
sqlTables - list with all sqlTables
connection - the connection
Throws:
java.lang.Exception

alterSQLTableTransactional

public ISQLInfo alterSQLTableTransactional(java.util.List sqlTables,
                                           java.sql.Connection connection)
                                    throws java.lang.Exception
This method alters a database table in transactional mode.

Call diagram of this method:

-execute sql to alter all tables

Parameters:
sqlTables - list with all sqlTables
connection - the connection
Throws:
java.lang.Exception

executeSQLTable

public ISQLInfo executeSQLTable(java.util.List sqlTables,
                                java.sql.Connection connection)
This method executes a serial of SQL actions(create,drop or alter) over a database table. At first, autocommit mode in connection is fixed to false, then its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. Moreover, Exceptions are also managed by this method.

Call diagram of this method:

-connection.setAutoCommit(false);
...
...
-executeSQLTableTransactional
...
...
-connection.setAutoCommit(true);

Parameters:
sqlTables - list with all sqlTables
connection - the connection

executeSQLTableTransactional

public ISQLInfo executeSQLTableTransactional(java.util.List sqlTables,
                                             java.sql.Connection connection)
                                      throws java.lang.Exception
This method executes a serial of SQL actions(create,drop or alter) over a database table in transactional mode.

Parameters:
sqlTables - list with all sqlTables
connection - the connection
Throws:
java.lang.Exception

getSQLTypeName

public java.lang.String getSQLTypeName(int sqlType)
                                throws java.lang.Exception
Throws:
java.lang.Exception

Ontimize