API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.db. JOTDBManager View Source
Author(s)
tcolar
Since
Version
Serial
Hierarchy
 Object
      JOTDBManager
Implements
Subclasses
Description
public class JOTDBManager
  Main database manager object.
See also:   
Constructors
private JOTDBManager ()
Methods
Hide/Show inherited methods
public JOTTaggedConnection getConnection () throws Exception
  returns a connection to the 'default' database
public JOTTaggedConnection getConnection (String dbName) throws Exception
  Gets a connection to a specified/named db.
publicfinalstatic JOTDBManager getInstance ()
 
public void loadDb (String name, JOTDBJDBCSetup setup) throws Exception
  Load a database configuration from a DBSetup object
publicsynchronized int nextVal (JOTTaggedConnection con, String id) throws Exception
  This is the equivalent of the nextval function on many database (ex:postgresql sequence) This is use to have a safe incremental counter(usually a primary key / ID).
public ResultSet query (JOTTaggedConnection con, String query, JOTStatementFlags flags) throws Exception
  It's is best/much safer to use query(con,query,params) as the parameters will be safely formatted for you (for example quotes in parameter values issues etc...) The query is gonna be something like "get * from toto where id=5"
public ResultSet query (JOTTaggedConnection con, String query, Object params, JOTStatementFlags flags) throws Exception
  Quick DB query, without having to open/close the connection manually.
public void releaseConnection (JOTTaggedConnection con)
  Release a connection to the DB pool
public void shutdown ()
disconnects all the open DB's and release resources
public boolean tableExists (String storageName, String table, boolean forceCheck) throws Exception
  Checks wether a table already exists or not in a DB unless forceCheck, if the table is found we wont check again
public void unCacheExitingTable (String dBName, String tableName)
public ResultSet update (JOTTaggedConnection con, String query) throws Exception
public ResultSet update (JOTTaggedConnection con, String query, JOTStatementFlags flags) throws Exception
  It's is best/much safer to use update(con,query,params) as the parameters will be safely formatted for you (for example quotes in parameter values issues etc...)
public ResultSet update (JOTTaggedConnection con, String query, Object params) throws Exception
public ResultSet update (JOTTaggedConnection con, String query, Object params, JOTStatementFlags flags) throws Exception
  Similar to query(con,query,params) but for the sql "update" Update is NOT used to make an "SQL update" (confusing name :-) But usually used to make a query which no result are expected such as an SQL "insert" command.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar