|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javatools.db.DbDatabase
A class that represents a particular database. A DbDatabase basically consists of some connection parameters plus we keep track of the open connections. The constructor is not public. Use DbManager.getDatabase().
Field Summary | |
protected boolean |
checkStatement
A flag indicating if a DBMS supports check clauses in its constraints. |
protected boolean |
foreignKey
A flag indicating if a DBMS supports foreign keys. |
protected boolean |
onDeleteCascade
A flag indicating if a DBMS supports ON DELETE CASCADE clauses in its constraints. |
protected boolean |
onDeleteSetDefault
A flag indicating if a DBMS supports ON DELETE SET DEFAULT clauses in its constraints. |
protected boolean |
onDeleteSetNull
A flag indicating if a DBMS supports ON DELETE SET NULL clauses in its constraints. |
protected boolean |
onUpdateCascade
A flag indicating if a DBMS supports ON UPDATE CASCADE clauses in its constraints. |
protected boolean |
onUpdateSetDefault
A flag indicating if a DBMS supports ON UPDATE SET DEFAULT clauses in its constraints. |
protected boolean |
onUpdateSetNull
A flag indicating if a DBMS supports ON UPDATE SET NULL clauses in its constraints. |
Constructor Summary | |
DbDatabase()
Builds a new DbDatabase empty object. |
|
DbDatabase(DbManager manager,
java.lang.String name,
java.lang.String driver,
java.lang.String connectString,
java.lang.String userName,
java.lang.String password)
Builds a new DbDatabase object. |
Method Summary | |
boolean |
equals(java.lang.Object o)
Checks if a DbDatabase object equals this one. |
DbExpr |
falseExpr()
Return an expression representing an SQL false expression. |
boolean |
getCheckStatement()
Returns the capability of DBMS to handle check statements. |
DbConnection |
getExistingThreadConnection()
Get a DbConnection that will be associated with this Thread, but only if one exists already. |
boolean |
getForeignKey()
Returns the capability of DBMS to handle foreign keys. |
DbJoinedTable |
getJoinedTable(DbAbstractTable tableLeft,
DbAbstractTable tableRight,
int joinType,
DbExpr joinCondition)
Returns a joined table. |
DbConnection |
getNewConnection()
Return a brand new DbConnection. |
boolean |
getOnDeleteCascade()
Returns the capability of DBMS to handle ON DELETE CASCADE clauses. |
boolean |
getOnDeleteSetDefault()
Returns the capability of DBMS to handle ON DELETE SET DEFAULT clauses. |
boolean |
getOnDeleteSetNull()
Returns the capability of DBMS to handle ON DELETE SET NULL clauses. |
boolean |
getOnUpdateCascade()
Returns the capability of DBMS to handle ON UPDATE CASCADE clauses. |
boolean |
getOnUpdateSetDefault()
Returns the capability of DBMS to handle ON UPDATE SET DEFAULT clauses. |
boolean |
getOnUpdateSetNull()
Returns the capability of DBMS to handle ON UPDATE SET NULL clauses. |
java.lang.String |
getProperty(java.lang.String pname)
A database can have a set of properties associated with it. |
DbSequence |
getSequence(java.lang.String name)
Ahem... uncommented. |
DbTable |
getTable(java.lang.String name)
Return an object representing a particular table in the database. |
DbConnection |
getThreadConnection()
Get a DbConnection that will be associated with this Thread. |
boolean |
hasThreadConnection()
Does this thread have a default connection associated with it? |
DbSelector |
selector()
Create a new DbSelector. |
void |
setAutoCommit(boolean pAutoCommit)
Sets autocommit property. |
void |
setProperty(java.lang.String pname,
java.lang.String value)
Set a property for this database. |
java.lang.String |
toString()
A database to a string? |
DbExpr |
trueExpr()
Return an expression representing an SQL true expression. |
DbExpr |
valueList(java.util.Collection col)
Returns a value list. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean foreignKey
true
: the DBMS supports foreign keys;
false
: otherwise.
protected boolean checkStatement
true
: the DBMS supports check clauses;
false
: otherwise.
protected boolean onDeleteCascade
true
: the DBMS supports ON DELETE CASCADE clauses;
false
: otherwise.
protected boolean onDeleteSetDefault
true
: the DBMS supports ON DELETE SET DEFAULT clauses;
false
: otherwise.
protected boolean onDeleteSetNull
true
: the DBMS supports ON DELETE SET NULL clauses;
false
: otherwise.
protected boolean onUpdateCascade
true
: the DBMS supports ON UPDATE CASCADE clauses;
false
: otherwise.
protected boolean onUpdateSetDefault
true
: the DBMS supports ON UPDATE SET DEFAULT clauses;
false
: otherwise.
protected boolean onUpdateSetNull
true
: the DBMS supports ON UPDATE SET NULL clauses;
false
: otherwise.
Constructor Detail |
public DbDatabase()
public DbDatabase(DbManager manager, java.lang.String name, java.lang.String driver, java.lang.String connectString, java.lang.String userName, java.lang.String password)
manager
- The manager of all databases.name
- The name of DBMS.driver
- The JDBC driver for this DBMS.connectString
- The connection string to connect the DBMS to.userName
- the user name to be used in connection.password
- The password to be used in connection.Method Detail |
public void setAutoCommit(boolean pAutoCommit)
pAutoCommit
- true
: each database update is autocommitted;
false
: commit must be made manually.public void setProperty(java.lang.String pname, java.lang.String value) throws DbException
pname
- The new property namevalue
- The new property value
DbException
- If something goes wrong.public java.lang.String getProperty(java.lang.String pname) throws DbException
pname
- The name of the property.
DbException
- If something goes wrong.public DbTable getTable(java.lang.String name) throws DbException
name
- The name of the table.
DbException
- If something goes wrong.public DbJoinedTable getJoinedTable(DbAbstractTable tableLeft, DbAbstractTable tableRight, int joinType, DbExpr joinCondition) throws DbException
tableLeft
- The table to be joined on the left.tableRight
- The table to be joined on the right.joinType
- The type of joining.joinCondition
- The join condition.
DbException
- If something goes wrong.public DbSequence getSequence(java.lang.String name)
name
- A name?
public DbConnection getThreadConnection() throws DbException
DbException
- If something goes wrong.public DbConnection getExistingThreadConnection() throws DbException
DbException
- If something goes wrong.public DbConnection getNewConnection() throws DbException
DbException
- If something goes wrong.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The object to compare to.
true
: the objects are equal;
false
: otherwise.public DbSelector selector() throws DbException
DbException
- If something goes wrong.public boolean hasThreadConnection()
true
: Yes it does;
false
: No it does not.public DbExpr trueExpr()
public DbExpr falseExpr()
public DbExpr valueList(java.util.Collection col)
col
- The collection containing the value list.
public java.lang.String toString()
toString
in class java.lang.Object
public boolean getForeignKey()
true
: the DBMS supports foreign keys;
false
: otherwise.public boolean getCheckStatement()
true
: the DBMS supports check clauses;
false
: otherwise.public boolean getOnDeleteCascade()
true
: the DBMS supports ON DELETE CASCADE clauses;
false
: otherwise.public boolean getOnDeleteSetDefault()
true
: the DBMS supports ON DELETE SET DEFAULT clauses;
false
: otherwise.public boolean getOnDeleteSetNull()
true
: the DBMS supports ON DELETE SET NULL clauses;
false
: otherwise.public boolean getOnUpdateCascade()
true
: the DBMS supports ON UPDATE CASCADE clauses;
false
: otherwise.public boolean getOnUpdateSetDefault()
true
: the DBMS supports ON UPDATE SET DEFAULT clauses;
false
: otherwise.public boolean getOnUpdateSetNull()
true
: the DBMS supports ON UPDATE SET NULL clauses;
false
: otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |