public class JotyDB
extends java.lang.Object
Together with the org.joty.workstation.data.WResultSet
class realizes
the interface with the virtual data level that the duality forms.
Modifier and Type | Field and Description |
---|---|
static java.sql.Connection |
m_conn |
boolean |
m_dbSessionIsOpen |
Constructor and Description |
---|
JotyDB() |
Modifier and Type | Method and Description |
---|---|
boolean |
acquireLock(java.lang.String tabName) |
void |
beginTrans() |
void |
commitTrans() |
static java.sql.Statement |
createStmnt() |
static java.sql.Statement |
createStmnt(boolean forUpdate) |
boolean |
executeBytesStmnt(java.lang.String sql,
byte[] bytes,
org.joty.common.BasicPostStatement postStatement) |
boolean |
executeReturningStmnt(java.lang.String sqlStmnt,
java.lang.String autoID,
org.joty.common.BasicPostStatement postStatement) |
boolean |
executeSQL(java.lang.String sql) |
boolean |
executeSQL(java.lang.String sql,
java.lang.String autoID) |
boolean |
executeSQL(java.lang.String sql,
java.lang.String autoID,
org.joty.common.BasicPostStatement contextPostStatement) |
boolean |
executeSQL(java.lang.String sql,
java.lang.String autoID,
org.joty.common.BasicPostStatement contextPostStatement,
int nonManagedRollbackAction)
A dual method for performing or 'delaying' the execution of a sql
statement
|
org.joty.access.Accessor |
getAccessor() |
long |
getAutoIdVal() |
byte[] |
getBytesFromDb(java.lang.String sql,
org.joty.common.BasicPostStatement postStatement) |
boolean |
getDbConn(boolean autoCommit)
Gets a jdbc
Connection object specifying the database url caught
from the configuration file and the user credentials living in the
Application object. |
org.joty.access.DbManager |
getDbManager() |
void |
rollbackTrans() |
void |
setPostStatement(org.joty.common.BasicPostStatement postStatement) |
public static java.sql.Connection m_conn
public boolean m_dbSessionIsOpen
public static java.sql.Statement createStmnt() throws java.sql.SQLException, javax.naming.NamingException
java.sql.SQLException
javax.naming.NamingException
public static java.sql.Statement createStmnt(boolean forUpdate) throws java.sql.SQLException, javax.naming.NamingException
java.sql.SQLException
javax.naming.NamingException
public boolean acquireLock(java.lang.String tabName)
public void beginTrans()
public void commitTrans() throws org.joty.app.JotyException
org.joty.app.JotyException
public boolean executeBytesStmnt(java.lang.String sql, byte[] bytes, org.joty.common.BasicPostStatement postStatement)
public boolean executeReturningStmnt(java.lang.String sqlStmnt, java.lang.String autoID, org.joty.common.BasicPostStatement postStatement)
public boolean executeSQL(java.lang.String sql)
public boolean executeSQL(java.lang.String sql, java.lang.String autoID)
public boolean executeSQL(java.lang.String sql, java.lang.String autoID, org.joty.common.BasicPostStatement contextPostStatement)
public boolean executeSQL(java.lang.String sql, java.lang.String autoID, org.joty.common.BasicPostStatement contextPostStatement, int nonManagedRollbackAction)
sql
- the statement textautoID
- a possible auto incrementing field namecontextPostStatement
- the BasicPostStatement objectnonManagedRollbackAction
- only used in web mode : if greater than zero it identifies this statement as non managed by the transaction system - the execution of the statement must be tracked autonomously
for looking, in the case of transaction failure and success of its execution, for a corresponding action identified by the same scalar value but of negative sign;
if less than zero it identifies this statement as rollback action non manageable by the transaction manager of the dbms system and corresponding to the direct action
identified by the same scalar value.public org.joty.access.Accessor getAccessor()
public long getAutoIdVal()
public byte[] getBytesFromDb(java.lang.String sql, org.joty.common.BasicPostStatement postStatement)
public boolean getDbConn(boolean autoCommit) throws java.sql.SQLException
Connection
object specifying the database url caught
from the configuration file and the user credentials living in the
Application
object. The Connection object is then stored in
m_conn
member variable. If the dbms is MS SqlServer the method
drives the framework to use unconditionally
CreateStatement
method of the Connection object instead of
PrepareStatement
method.autoCommit
- true if the connection will perform auto-commit statement
executions.java.sql.SQLException
public org.joty.access.DbManager getDbManager()
public void rollbackTrans() throws org.joty.app.JotyException
org.joty.app.JotyException
public void setPostStatement(org.joty.common.BasicPostStatement postStatement)