| 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 | |
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 void | close() | public JDCConnectionPool | connectionPool() | public static int | currVal(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 int | currVal(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 String | escape(java.util.Date dt, String sFormat) | public static String | escape(Timestamp ts, String sFormat) | public static boolean | exists(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 JDCConnection | getConnection(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 DBTable | getDBTable(String sTable) | public HashMap | getDBTablesMap() | public static String | getDataModelVersion(JDCConnection oConn) | public static int | getDataModelVersionNumber(JDCConnection oConn) | public String | getDatabaseProductName() | public String | getProfileName() | public static DBTable | getTable(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 long | getTime() | protected void | initialize(String sProfile) | public static int | nextVal(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 int | nextVal(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 void | restart() |
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) | | |
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. |
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 |
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 |
getTime | public static long getTime()(Code) | | Get Current System Time |
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. |
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)
|
|
|