Java Doc for AbstractDataStoreInterface.java in  » Content-Management-System » harmonise » org » openharmonise » commons » dsi » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » harmonise » org.openharmonise.commons.dsi 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.openharmonise.commons.dsi.AbstractDataStoreInterface

All known Subclasses:   org.openharmonise.commons.dsi.impl.DataStoreInterfaceOracle,  org.openharmonise.commons.dsi.impl.DataStoreInterfaceFirebird,  org.openharmonise.commons.dsi.impl.DataStoreInterfaceMySQL,  org.openharmonise.commons.dsi.impl.DataStoreInterfaceSQLServer,
AbstractDataStoreInterface
abstract public class AbstractDataStoreInterface extends Object (Code)
Class providing interface to the database. Contains general purpose functions that run queries and extract cached info such as the data schema and language-dependent text.
author:
   Michael Bell
See Also:   java.sql
See Also:   oracle.sql


Field Summary
final public static  intDB_CONNECTION_BROKER
    
protected static  StringDB_DATEFORMAT
    
final public static  intOTHER_CONNECTION
    
final public static  intPOOLED_CONNECTION
    
protected static  booleanm_bIsNationalCharacterSupported
    

Constructor Summary
public  AbstractDataStoreInterface()
    
public  AbstractDataStoreInterface(String sJDBCDriver, String sDBurl, String sDBUsr, String sDBPwd)
     Constructs a data store interface with the given connection parameters.
public  AbstractDataStoreInterface(int nConnectionType)
     Constructs a data store interface with the specified connection type.

Method Summary
abstract protected  StringaddEscapeChars(String sOldString)
     Returns an escaped string which can be entered in to the database without 'special' characters causing a problem.
public  voidcloseConnection(Connection conn)
     Closes the connection to the database.
abstract public  voidcreateTable(TableDefinition tblDef)
     Creates a new database table from the given table definition.
public  voiddisconnect()
     Disconnects from database.
public  voidexecute(String sSql)
     Executes SQL query specified by sSql on the database.
public  ResultSetexecute(SelectStatement query)
     Executes the given select statement on the database.
public  intexecute(UpdateStatement update)
     Executes the given update statement on the database.
public  voidexecute(InsertStatement insert)
     Executes the given insert statement on the database.
public  voidexecute(DeleteStatement delete)
     Executes the given delete statement on the database.
public  voidexecuteInsert(InsertStatement insert)
     Executes the given insert statement on the database.
public  ResultSetexecuteQuery(String sSql)
     Executes a specified SQL query on the database.
public  ResultSetexecuteQuery(SelectStatement query)
     Executes the given select statement on the database.
public  intexecuteUpdate(String sSql)
     Executes a specified SQL update statement on the database.
public  intexecuteUpdate(UpdateStatement update)
     Executes the given update statement on the database.
protected  StringgenerateFromClause(SelectStatement select)
     Returns the SQL 'from' clause for the given AbstractDMLStatement and the list of tables.
protected  StringgenerateOrderByClause(SelectStatement select)
     Returns the SQL 'order by' clause for the given SelectStatement.
protected  StringgenerateWhereClause(SelectStatement select)
     Returns the SQL where clause for the SQL statement corresponding to the given SelectStatement, including the necessary join conditions.
protected  StringgenerateWhereClause(AbstractDMLStatement DML)
     Returns the SQL where clause for the given AbstractDMLStatement.
protected  StringgenerateWhereClause(WhereConditionGroup where)
     Returns the SQL where clause for the given collection of where conditions.
abstract public  StringgetBooleanDataType()
     Returns the boolean datatype for this data store interface.
abstract public  StringgetCLOBDataType()
     Returns the SQL CLOB datatype for this data store interface.
abstract public  StringgetClob(String sTable, String sColumn, String sCondition)
     Returns the text held in a CLOB field in the database.
public  ConnectiongetConnection()
     Returns the database connection.
public  StringgetDatabaseURL()
     Returns the URL of the database.
abstract protected  StringgetDateAsSQL(String date)
     Returns the given date formatted for use in a SQL statement.
abstract public  StringgetDateDataType()
     Returns the SQL date datatype for this data store interface.
public  StringgetDeleteStatement(DeleteStatement delete)
     Returns the SQL delete statement corresponding to the given DeleteStatement.
abstract protected  StringgetFunction(Function func)
     Returns the SQL function for the given Function.
public  StringgetInsertStatement(InsertStatement insert)
     Returns the SQL statement corresponding to the given InsertStatement.
abstract public  StringgetJoinCondition(ColumnRef ref1, ColumnRef ref2, boolean bIsOuter)
     Returns the SQL join condition statement joining the two given column references, taking in to account whether the join should be an outer join.
protected  StringgetOrderByRef(ColumnRef ordercol)
     Returns the SQL string to include in to the SQL select statement to ensure correct ordering of the result set.
public  StringgetSelectStatement(SelectStatement select)
     Returns the SQL select statement corresponding to the given SelectStatement.
abstract public  ListgetSequenceList()
     Returns the list of sequences available in the database.
abstract public  intgetSequenceNextValue(String sSeqName)
     Returns the next value in the specified sequence.
abstract public  ListgetTableList()
     Returns the list of tables contained in the database.
public  StringgetUpdateStatement(UpdateStatement update)
     Returns the SQL update statement corresponding to the given UpdateStatement.
public  voidinitialise(int nConnectionType)
     Initialise this data store interface with the specified connection type.
abstract public  voidinsertClob(String sTable, String sColumn, String sClob, String sCondition)
     Inserts CLOB data into database.
protected  booleanisNationalCharacterSupported()
    
public  booleanisPooledConnection()
     Returns true if whether this data store interface uses a pooled connection.
public  booleanisTableExist(String sTableName)
     Returns true of the specified table exists.
public static  java.util.DateparseDate(String sDate)
     Returns the given String as a Date, using the default date format for parsing.
public  voidsetDataStoreDetails(String sJDBCDriver, String sDBurl, String sDBUsr, String sDBPwd)
     Sets the connection details for this data store interface.
protected  voidsetNationalCharacterSupport(boolean bIsSupported)
    
abstract public  voidupdateClob(String sTable, String sColumn, String sClob, String sCondition)
     Updates CLOB text in the database.

Field Detail
DB_CONNECTION_BROKER
final public static int DB_CONNECTION_BROKER(Code)
Consant indication a db connection broker connection



DB_DATEFORMAT
protected static String DB_DATEFORMAT(Code)
Date format for database



OTHER_CONNECTION
final public static int OTHER_CONNECTION(Code)
Constant indicating a non-pooled connection



POOLED_CONNECTION
final public static int POOLED_CONNECTION(Code)
Constant indicating a pooled connection



m_bIsNationalCharacterSupported
protected static boolean m_bIsNationalCharacterSupported(Code)
Boolean flag to indicate whether the DB supports the F421 National Character feature




Constructor Detail
AbstractDataStoreInterface
public AbstractDataStoreInterface()(Code)
Constructor an simple data store interface with no details set



AbstractDataStoreInterface
public AbstractDataStoreInterface(String sJDBCDriver, String sDBurl, String sDBUsr, String sDBPwd)(Code)
Constructs a data store interface with the given connection parameters.
Parameters:
  sJDBCDriver - the JDBC driver class name
Parameters:
  sDBurl - the database URI
Parameters:
  sDBUsr - the database user name
Parameters:
  sDBPwd - the database user password



AbstractDataStoreInterface
public AbstractDataStoreInterface(int nConnectionType) throws DataStoreException(Code)
Constructs a data store interface with the specified connection type.
Parameters:
  nConnectionType - the connection type
throws:
  Exception - if the specified connection type is invalid




Method Detail
addEscapeChars
abstract protected String addEscapeChars(String sOldString)(Code)
Returns an escaped string which can be entered in to the database without 'special' characters causing a problem.
Parameters:
  sOldString - contains the string to be checked the String of the new text, including any changes made if they were necessary



closeConnection
public void closeConnection(Connection conn)(Code)
Closes the connection to the database.
Parameters:
  conn - the connection



createTable
abstract public void createTable(TableDefinition tblDef) throws DataStoreException(Code)
Creates a new database table from the given table definition.
Parameters:
  tblDef - the definition of the table to create
throws:
  DataStoreException - if an error occurs creating the new table



disconnect
public void disconnect() throws SQLException(Code)
Disconnects from database.
exception:
  SQLException - if an error occurs closing the connection



execute
public void execute(String sSql) throws DataStoreException(Code)
Executes SQL query specified by sSql on the database.
Parameters:
  sSql - SQL Query
exception:
  DataStoreException - if an error occurs



execute
public ResultSet execute(SelectStatement query) throws DataStoreException(Code)
Executes the given select statement on the database.
Parameters:
  query - the select statement the resultant result set
throws:
  DataStoreException - if an error occurs



execute
public int execute(UpdateStatement update) throws DataStoreException(Code)
Executes the given update statement on the database.
Parameters:
  update - the update statement a success code
throws:
  DataStoreException - if an error occurs



execute
public void execute(InsertStatement insert) throws DataStoreException(Code)
Executes the given insert statement on the database.
Parameters:
  insert - the insert statement
throws:
  DataStoreException - if an error occurs



execute
public void execute(DeleteStatement delete) throws DataStoreException(Code)
Executes the given delete statement on the database.
Parameters:
  delete - the delete statement
throws:
  DataStoreException - if an error occurs



executeInsert
public void executeInsert(InsertStatement insert) throws DataStoreException(Code)
Executes the given insert statement on the database.
Parameters:
  insert - the insert statement
throws:
  DataStoreException - if an error occurs



executeQuery
public ResultSet executeQuery(String sSql) throws DataStoreException(Code)
Executes a specified SQL query on the database.
Parameters:
  sSql - the SQL Query the result of the query
exception:
  DataStoreException -



executeQuery
public ResultSet executeQuery(SelectStatement query) throws DataStoreException(Code)
Executes the given select statement on the database.
Parameters:
  query - the select statement the resultant result set
throws:
  DataStoreException - if an error occurs



executeUpdate
public int executeUpdate(String sSql) throws DataStoreException(Code)
Executes a specified SQL update statement on the database.
Parameters:
  sSql - SQL update statement a code indicating success
exception:
  DataStoreException -



executeUpdate
public int executeUpdate(UpdateStatement update) throws DataStoreException(Code)
Executes the given update statement on the database.
Parameters:
  update - the update statement a success code
throws:
  DataStoreException - if an error occurs



generateFromClause
protected String generateFromClause(SelectStatement select) throws DataStoreException(Code)
Returns the SQL 'from' clause for the given AbstractDMLStatement and the list of tables.
Parameters:
  select - the select statement the SQL 'from' clause
throws:
  DataStoreException - if an error occurs



generateOrderByClause
protected String generateOrderByClause(SelectStatement select)(Code)
Returns the SQL 'order by' clause for the given SelectStatement.
Parameters:
  select - the select statement the SQL 'order by' clause



generateWhereClause
protected String generateWhereClause(SelectStatement select) throws DataStoreException(Code)
Returns the SQL where clause for the SQL statement corresponding to the given SelectStatement, including the necessary join conditions.
Parameters:
  select - the select statement the SQL where clause
throws:
  DataStoreException - if an error occurs



generateWhereClause
protected String generateWhereClause(AbstractDMLStatement DML) throws DataStoreException(Code)
Returns the SQL where clause for the given AbstractDMLStatement.
Parameters:
  DML - the DML statement the SQL where clause
throws:
  DataStoreException - if an error occurs



generateWhereClause
protected String generateWhereClause(WhereConditionGroup where) throws DataStoreException(Code)
Returns the SQL where clause for the given collection of where conditions.
Parameters:
  where - the collection of where conditions the SQL where clause
throws:
  DataStoreException - if an error occurs



getBooleanDataType
abstract public String getBooleanDataType()(Code)
Returns the boolean datatype for this data store interface. the boolean datatype for this data store interface



getCLOBDataType
abstract public String getCLOBDataType()(Code)
Returns the SQL CLOB datatype for this data store interface. the SQL CLOB datatype



getClob
abstract public String getClob(String sTable, String sColumn, String sCondition) throws DataStoreException(Code)
Returns the text held in a CLOB field in the database.
Parameters:
  sTable - the table name
Parameters:
  sColumn - the colmn name
Parameters:
  sCondition - the condition for location of the CLOB
throws:
  DataStoreException -



getConnection
public Connection getConnection() throws DataStoreException(Code)
Returns the database connection. the database connection.
throws:
  DataStoreException - if a connection can not be created



getDatabaseURL
public String getDatabaseURL()(Code)
Returns the URL of the database. the URL of the database



getDateAsSQL
abstract protected String getDateAsSQL(String date)(Code)
Returns the given date formatted for use in a SQL statement.
Parameters:
  date - the date as a string the SQL date representation



getDateDataType
abstract public String getDateDataType()(Code)
Returns the SQL date datatype for this data store interface. the SQL date datatype



getDeleteStatement
public String getDeleteStatement(DeleteStatement delete) throws DataStoreException(Code)
Returns the SQL delete statement corresponding to the given DeleteStatement.
Parameters:
  delete - the delete statement the SQL statement
throws:
  DataStoreException - if any errors occur



getFunction
abstract protected String getFunction(Function func) throws DataStoreException(Code)
Returns the SQL function for the given Function.
Parameters:
  func - the function the SQL function
throws:
  DataStoreException - if an error occurs



getInsertStatement
public String getInsertStatement(InsertStatement insert) throws DataStoreException(Code)
Returns the SQL statement corresponding to the given InsertStatement.
Parameters:
  insert - the insert statement the SQL statement
throws:
  DataStoreException - if any arrors occur



getJoinCondition
abstract public String getJoinCondition(ColumnRef ref1, ColumnRef ref2, boolean bIsOuter)(Code)
Returns the SQL join condition statement joining the two given column references, taking in to account whether the join should be an outer join.
Parameters:
  ref1 - the column reference on the left side of the join
Parameters:
  ref2 - the column reference on the right side of the join
Parameters:
  bIsOuter - true if the join is an outer join the SQL join condition



getOrderByRef
protected String getOrderByRef(ColumnRef ordercol)(Code)
Returns the SQL string to include in to the SQL select statement to ensure correct ordering of the result set.
Parameters:
  ordercol - the column reference the SQL string to include in the SQL select statement



getSelectStatement
public String getSelectStatement(SelectStatement select) throws DataStoreException(Code)
Returns the SQL select statement corresponding to the given SelectStatement.
Parameters:
  select - the select statement the SQL statement
throws:
  DataStoreException - if an error occurs



getSequenceList
abstract public List getSequenceList() throws DataStoreException(Code)
Returns the list of sequences available in the database. the list of sequences available in the database
throws:
  DataStoreException -



getSequenceNextValue
abstract public int getSequenceNextValue(String sSeqName) throws DataStoreException, SQLException(Code)
Returns the next value in the specified sequence.
Parameters:
  sSeqName - name of sequence the next value in the specified sequence.
throws:
  DataStoreException - if there is an error building the query at the data store interface level
throws:
  SQLException - if there is an error at the jdbc level



getTableList
abstract public List getTableList() throws DataStoreException(Code)
Returns the list of tables contained in the database. the list of tables contained in the database
throws:
  DataStoreException - if an error occurs



getUpdateStatement
public String getUpdateStatement(UpdateStatement update) throws DataStoreException(Code)
Returns the SQL update statement corresponding to the given UpdateStatement.
Parameters:
  update - the update statement the SQL statement
throws:
  DataStoreException - if any errors occur



initialise
public void initialise(int nConnectionType) throws Exception(Code)
Initialise this data store interface with the specified connection type.
Parameters:
  nConnectionType - the connection type
throws:
  Exception - if the specified connection type is invalid



insertClob
abstract public void insertClob(String sTable, String sColumn, String sClob, String sCondition) throws DataStoreException(Code)
Inserts CLOB data into database.
Parameters:
  sTable - the table name
Parameters:
  sColumn - the column name
Parameters:
  sClob - the CLOB text
Parameters:
  sCondition - the condition attached to the insert statement
throws:
  DataStoreException - if an error occurs



isNationalCharacterSupported
protected boolean isNationalCharacterSupported()(Code)
Returns true if the DB supports the F421 SQL National Character feature true if the DB supports the F421 SQL National Character feature



isPooledConnection
public boolean isPooledConnection()(Code)
Returns true if whether this data store interface uses a pooled connection. true if whether this data store interface uses a pooled connection.



isTableExist
public boolean isTableExist(String sTableName) throws DataStoreException(Code)
Returns true of the specified table exists.
Parameters:
  sTableName - the table name true of the specified table exists
throws:
  DataStoreException - if an error occurs



parseDate
public static java.util.Date parseDate(String sDate) throws ParseException(Code)
Returns the given String as a Date, using the default date format for parsing.
Parameters:
  sDate - the string representation for the date the date object
throws:
  ParseException - if a parse error occurs



setDataStoreDetails
public void setDataStoreDetails(String sJDBCDriver, String sDBurl, String sDBUsr, String sDBPwd)(Code)
Sets the connection details for this data store interface.
Parameters:
  sJDBCDriver - the JDBC driver class name
Parameters:
  sDBurl - the database URI
Parameters:
  sDBUsr - the database user name
Parameters:
  sDBPwd - the database user password



setNationalCharacterSupport
protected void setNationalCharacterSupport(boolean bIsSupported)(Code)
Sets whether the DB supports the F421 SQL National Character feature
Parameters:
  bIsSupported - true if the DB supports the F421 SQL National Character feature



updateClob
abstract public void updateClob(String sTable, String sColumn, String sClob, String sCondition) throws DataStoreException(Code)
Updates CLOB text in the database.
Parameters:
  sTable - the table name
Parameters:
  sColumn - the column name
Parameters:
  sClob - the clob text
Parameters:
  sCondition - the condition for locating the fields to update
throws:
  DataStoreException - if an error occurs



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.