Java Doc for DBBind.java in  » Groupware » hipergate » com » knowgate » dataobjs » 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 » Groupware » hipergate » com.knowgate.dataobjs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.beans.Beans
      com.knowgate.dataobjs.DBBind

All known Subclasses:   com.knowgate.dataobjs.DBSite,  com.knowgate.dataobjs.DBDemo,  com.knowgate.dataobjs.DBExtranet,  com.knowgate.dataobjs.DBWeb,  com.knowgate.dataobjs.DBCRM,  com.knowgate.dataobjs.DBDevel,  com.knowgate.dataobjs.DBIntranet,  com.knowgate.dataobjs.DBReal,  com.knowgate.dataobjs.DBWork,  com.knowgate.dataobjs.DBApp,  com.knowgate.dataobjs.DBShop,  com.knowgate.dataobjs.DBPortal,  com.knowgate.dataobjs.DBSupport,  com.knowgate.dataobjs.DBTest,
DBBind
public class DBBind extends Beans (Code)

Singleton object for database binding.


author:
   Sergio Montoro Ten
version:
   3.0

Inner Class :public static class Functions

Field Summary
final public static  intDBMS_GENERIC
    
final public static  intDBMS_MSSQL
    
final public static  intDBMS_MYSQL
    
final public static  intDBMS_ORACLE
    
final public static  intDBMS_POSTGRESQL
    

Constructor Summary
public  DBBind()
    

Create DBBind.

Read database connection properties from hipergate.cnf.
This file must be placed at the directory pointed by KNOWGATE_PROFILES environment variable.
By defualt hipergate.cnf is placed on C:\WINNT\ for Windows Systems and /etc/ for UNIX Systems.
public  DBBind(String sProfile)
    

Create DBBind.

Read database connection properties from specified properties file.

Method Summary
public  voidclose()
    
public  JDCConnectionPoolconnectionPool()
    
public static  intcurrVal(JDCConnection oConn, String sSequenceName)
    

Get current value for a sequence


Parameters:
  oConn - JDCConnection
Parameters:
  sSequenceName - Sequence name.In MySQL and SQL Server sequences are implemented using row locks at k_sequences table.
public static  intcurrVal(Connection oSQLConn, String sSequenceName)
    

Get current value for a sequence


Parameters:
  oSQLConn - Database connection
Parameters:
  sSequenceName - Sequence name.In MySQL and SQL Server sequences are implemented using row locks at k_sequences table.
public static  Stringescape(java.util.Date dt, String sFormat)
    
public static  Stringescape(Timestamp ts, String sFormat)
    
public static  booleanexists(JDCConnection oConn, String sObjectName, String sObjectType)
     Checks if an object exists at database Checking is done directly against database catalog tables, if current user does not have enought priviledges for reading database catalog tables methos may fail or return a wrong result.
public synchronized  JDCConnectiongetConnection(String sCaller)
    

Get a JDCConnection instance from connection pool


Parameters:
  sCaller - Symbolic name identifying the caller program or subroutine,this field is used for statistical control of database accesses,performance tunning and debugging open/close mismatch.
public  DBTablegetDBTable(String sTable)
    
public  HashMapgetDBTablesMap()
    
public static  StringgetDataModelVersion(JDCConnection oConn)
    
public static  intgetDataModelVersionNumber(JDCConnection oConn)
    
public  StringgetDatabaseProductName()
    
public  StringgetProfileName()
    
public static  DBTablegetTable(String sTable)
    

Get DBTable object by name


Parameters:
  sTable - Table name DBTable object or null if no table was found with given name.
throws:
  IllegalStateException - DBTable objects are cached in a static HasMap,the HashMap is loaded upon first call to a DBBind constructor.
public static  longgetTime()
    
protected  voidinitialize(String sProfile)
    
public static  intnextVal(JDCConnection oConn, String sSequenceName)
    

Get next value for a sequence


Parameters:
  oConn - JDCConnection
Parameters:
  sSequenceName - Sequence name.In MySQL and SQL Server sequences are implemented using row locks at k_sequences table.
public static  intnextVal(Connection oSQLConn, String sSequenceName)
    

Get next value for a sequence


Parameters:
  oSQLConn - Database connection
Parameters:
  sSequenceName - Sequence name.In MySQL and SQL Server sequences are implemented using row locks at k_sequences table.
public  voidrestart()
    

Field Detail
DBMS_GENERIC
final public static int DBMS_GENERIC(Code)



DBMS_MSSQL
final public static int DBMS_MSSQL(Code)



DBMS_MYSQL
final public static int DBMS_MYSQL(Code)



DBMS_ORACLE
final public static int DBMS_ORACLE(Code)



DBMS_POSTGRESQL
final public static int DBMS_POSTGRESQL(Code)




Constructor Detail
DBBind
public DBBind()(Code)

Create DBBind.

Read database connection properties from hipergate.cnf.
This file must be placed at the directory pointed by KNOWGATE_PROFILES environment variable.
By defualt hipergate.cnf is placed on C:\WINNT\ for Windows Systems and /etc/ for UNIX Systems.



DBBind
public DBBind(String sProfile)(Code)

Create DBBind.

Read database connection properties from specified properties file.
Parameters:
  sProfile - Name of properties file without extension.
For example "hipergate" or "portal".
The properties file must be placed at the directory pointed byKNOWGATE_PROFILES environment variables.




Method Detail
close
public void close()(Code)

Close DBBind

Close connections from pool.
Stop connection reaper.



connectionPool
public JDCConnectionPool connectionPool()(Code)
Get connection pool used by this database binding Reference to JDCConnectionPool



currVal
public static int currVal(JDCConnection oConn, String sSequenceName) throws SQLException, UnsupportedOperationException(Code)

Get current value for a sequence


Parameters:
  oConn - JDCConnection
Parameters:
  sSequenceName - Sequence name.In MySQL and SQL Server sequences are implemented using row locks at k_sequences table. Current sequence value
throws:
  SQLException -
throws:
  UnsupportedOperationException - Not all databases support sequences.On Oracle and PostgreSQL, native SEQUENCE objects are used,on MySQL and Microsoft SQL Server the stored procedure k_sp_currval simulates sequences,this function is not supported on other DataBase Management Systems.
since:
   3.0



currVal
public static int currVal(Connection oSQLConn, String sSequenceName) throws SQLException, UnsupportedOperationException(Code)

Get current value for a sequence


Parameters:
  oSQLConn - Database connection
Parameters:
  sSequenceName - Sequence name.In MySQL and SQL Server sequences are implemented using row locks at k_sequences table. Current sequence value
throws:
  SQLException -
throws:
  UnsupportedOperationException - Not all databases support sequences.On Oracle and PostgreSQL, native SEQUENCE objects are used,on MySQL and Microsoft SQL Server the stored procedure k_sp_nextval simulates sequences,this function is not supported on other DataBase Management Systems.
since:
   3.0



escape
public static String escape(java.util.Date dt, String sFormat) throws IllegalArgumentException(Code)
Format Date in ODBC escape sequence style
Parameters:
  dt - Date to be formated
Parameters:
  sFormat - Format Type "d" or "ts" or "shortTime".Use d for { d 'yyyy-mm-dd' }, use ts for { ts 'ts=yyyy-mm-dd hh:nn:ss' }
use shortTime for hh:mm
use shortDate for yyyy-mm-dd
use dateTime for yyyy-mm-dd hh:mm:ss
Formated date
throws:
  IllegalArgumentException - if dt is of type java.sql.Date



escape
public static String escape(Timestamp ts, String sFormat)(Code)
Format Timestamp in ODBC escape sequence style
Parameters:
  ts - Timestamp to be formated
Parameters:
  sFormat - Format Type "d" or "ts" or "shortTime".Use d for { d 'yyyy-mm-dd' }, use ts for { ts 'ts=yyyy-mm-dd hh:nn:ss' }
use shortTime for hh:mm
use shortDate for yyyy-mm-dd
use dateTime for yyyy-mm-dd hh:mm:ss
Formated date
since:
   3.0



exists
public static boolean exists(JDCConnection oConn, String sObjectName, String sObjectType) throws SQLException, UnsupportedOperationException(Code)
Checks if an object exists at database Checking is done directly against database catalog tables, if current user does not have enought priviledges for reading database catalog tables methos may fail or return a wrong result.
Parameters:
  oConn - Database connection
Parameters:
  sObjectName - Objeto name
Parameters:
  sObjectType - Objeto typeC = CHECK constraintD = Default or DEFAULT constraintF = FOREIGN KEY constraintL = LogP = Stored procedurePK = PRIMARY KEY constraint (type is K)RF = Replication filter stored procedureS = System tableTR = TriggerU = User tableUQ = UNIQUE constraint (type is K)V = ViewX = Extended stored procedure true if object exists, false otherwise
throws:
  SQLException -
throws:
  UnsupportedOperationException - If current database management system is not supported for this method



getConnection
public synchronized JDCConnection getConnection(String sCaller) throws SQLException(Code)

Get a JDCConnection instance from connection pool


Parameters:
  sCaller - Symbolic name identifying the caller program or subroutine,this field is used for statistical control of database accesses,performance tunning and debugging open/close mismatch. An open connection to the database.
throws:
  SQLException -



getDBTable
public DBTable getDBTable(String sTable) throws IllegalStateException(Code)

Get DBTable object by name


Parameters:
  sTable - Table name DBTable object or null if no table was found with given name.
throws:
  IllegalStateException - DBTable objects are cached in a static HasMap,the HashMap is loaded upon first call to a DBBind constructor.If getDBTable() is called before creating any instance of DBBind then anIllegalStateException will be thrown.
since:
   2.0



getDBTablesMap
public HashMap getDBTablesMap() throws IllegalStateException(Code)

Get map of DBTable objects

HashMap
throws:
  IllegalStateException - DBTable objects are cached in a static HasMap,the HashMap is loaded upon first call to a DBBind constructor.If getDBTablesMap() is called before creating any instance of DBBindthen an IllegalStateException will be thrown.
since:
   3.0



getDataModelVersion
public static String getDataModelVersion(JDCConnection oConn) throws SQLException(Code)
Get datamodel version
Parameters:
  oConn - JDCConnection object vs_stamp field from k_version table
throws:
  SQLException -



getDataModelVersionNumber
public static int getDataModelVersionNumber(JDCConnection oConn) throws SQLException(Code)
Get datamodel version number
Parameters:
  oConn - JDCConnection object for 2.0.8-> 20008 , 2.1.0 -> 20100, etc.
throws:
  SQLException -



getDatabaseProductName
public String getDatabaseProductName() throws SQLException(Code)
Get the name of Database Management System Connected one of { "Microsoft SQL Server", "Oracle", "PostgreSQL" }
throws:
  SQLException -



getProfileName
public String getProfileName()(Code)

Get Name of profile used for initializing DBBind

Profile Name is the properties file name ("hipergate.cnf") without extension.
For example "hipergate", "real", "demo", "test", "portal" Profile name



getTable
public static DBTable getTable(String sTable) throws java.lang.IllegalStateException(Code)

Get DBTable object by name


Parameters:
  sTable - Table name DBTable object or null if no table was found with given name.
throws:
  IllegalStateException - DBTable objects are cached in a static HasMap,the HashMap is loaded upon first call to a DBBind constructor. If getTable()is called before creating any instance of DBBind an IllegalStateExceptionwill be raised.DBBind.getDBTable(String) getDBTable



getTime
public static long getTime()(Code)
Get Current System Time



initialize
protected void initialize(String sProfile) throws ClassNotFoundException, SQLException, NullPointerException, AccessControlException, UnsatisfiedLinkError, NumberFormatException(Code)



nextVal
public static int nextVal(JDCConnection oConn, String sSequenceName) throws SQLException, UnsupportedOperationException(Code)

Get next value for a sequence


Parameters:
  oConn - JDCConnection
Parameters:
  sSequenceName - Sequence name.In MySQL and SQL Server sequences are implemented using row locks at k_sequences table. int Next sequence value
throws:
  SQLException -
throws:
  UnsupportedOperationException - Not all databases support sequences.On Oracle and PostgreSQL, native SEQUENCE objects are used,on Microsoft SQL Server the stored procedure k_sp_nextval simulates sequences,this function is not supported on other DataBase Management Systems.
since:
   3.0



nextVal
public static int nextVal(Connection oSQLConn, String sSequenceName) throws SQLException, UnsupportedOperationException(Code)

Get next value for a sequence


Parameters:
  oSQLConn - Database connection
Parameters:
  sSequenceName - Sequence name.In MySQL and SQL Server sequences are implemented using row locks at k_sequences table. int Next sequence value
throws:
  SQLException -
throws:
  UnsupportedOperationException - Not all databases support sequences.On Oracle and PostgreSQL, native SEQUENCE objects are used,on Microsoft SQL Server the stored procedure k_sp_nextval simulates sequences,this function is not supported on other DataBase Management Systems.



restart
public void restart() throws SQLException, ClassNotFoundException(Code)
Close and reopen the connection pool and reload the table map cache
throws:
  SQLException -
throws:
  ClassNotFoundException -



Methods inherited from java.beans.Beans
public static Object getInstanceOf(Object bean, Class targetType)(Code)(Java Doc)
public static Object instantiate(ClassLoader cls, String beanName) throws java.io.IOException, ClassNotFoundException(Code)(Java Doc)
public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext) throws java.io.IOException, ClassNotFoundException(Code)(Java Doc)
public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext, AppletInitializer initializer) throws java.io.IOException, ClassNotFoundException(Code)(Java Doc)
public static boolean isDesignTime()(Code)(Java Doc)
public static boolean isGuiAvailable()(Code)(Java Doc)
public static boolean isInstanceOf(Object bean, Class targetType)(Code)(Java Doc)
public static void setDesignTime(boolean isDesignTime) throws SecurityException(Code)(Java Doc)
public static void setGuiAvailable(boolean isGuiAvailable) throws SecurityException(Code)(Java Doc)

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.