Java Doc for Connection.java in  » Database-DBMS » Quadcap-Embeddable-Database » com » quadcap » sql » 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 » Database DBMS » Quadcap Embeddable Database » com.quadcap.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.quadcap.sql.Connection

Connection
public class Connection implements TransactionObserver(Code)
Analagous (and mapped onto) a JDBC Connection, this class maintains state and locks on behalf of a single session.
author:
   Stan Bailes


Field Summary
 Stringauth
    
 booleanautoCommit
    
 ObjectconnLock
    
 Databasedb
    
 Lockdb_IS
    
 Lockdb_IX
    
 BlockFilefile
    
 ObjectfileLock
    
 intid
    
 booleanisClosed
    
static  intlastId
    
 longlastInsertId
    
 intnextSession
    
 Randomrandom
    
 booleanreadOnly
    
 Hashtablerlocks
    
 Listsessions
    
 Transactiontrans
    
 booleantransAborted
    
 HashtabletransContext
    
 longtransId
    
 Hashtablewlocks
    
 booleanwriteLog
    

Constructor Summary
public  Connection(Database db, String auth, String passwd)
    

Method Summary
public  voidabort(Transaction t)
    
final  voidcheckAborted()
    
final public  voidclose()
     Close this connection.
final  voidcloseSessions()
    
final static  intcountDots(String name)
    
final public  SessioncreateSession()
     Create a new session and store it in the session table.
 voidendStatement(Session session, boolean abort)
    
final public  voidendTransaction()
     Commit the current transaction PRE: cursors closed, statements finished.
final  voidfinishContexts()
     Each context object represents some state retained on behalf of a constraint.
final public  StringgetAuth()
    
final public  booleangetAutoCommit()
     Public accessor for the 'autoCommit' flag.
final  StatementContextgetContext(Object obj)
    
final public  DatabasegetDatabase()
    
final  LockgetDbLock(int mode)
     Get the database root lock in the specified mode.
final public  BlockFilegetFile()
    
public  StringgetLabel()
    
 longgetLastInsertId()
    
 RandomgetRandom()
    
final  SessiongetSession(int i)
    
final  voidgetTableReadLock(String tableName)
    
final  voidgetTableWriteLock(String tableName)
    
final  BlockFilegetTempFile(boolean holdRef)
     The BLOB code (InsertBlob) needs access to the temp file.
final public  TransactiongetTransaction()
    
final public  longgetTransactionId()
     Return the current transaction id as a long.
final  booleaninRecovery()
    
public  booleanisClosed()
    
public  booleanisReadOnly()
    
final  BtreemakeTempTree(Comparator compare)
     Make a new (temporary) btree structure in the current database.
final  BtreemakeTempTree()
    
final  TransactionmakeTransaction()
    
final  voidputContext(Object key, StatementContext val)
    
final  voidreleaseLocks()
     At transaction end, release our cached locks.
final public  voidremoveSession(Session session)
    
final  StringresolveColname(String name, Tuple cursorTuple)
     Return a fully qualified column name.
final  StringresolveName(String name)
     Given a SQL ID, attempt to generate a fully qualified name by prepending the current schema name.
final  voidrollbackStatement(Session s)
    
final public  voidrollbackTransaction()
     Roll back this transaction.
final public  voidsetAuth(String auth, String passwd)
    
final public  voidsetAutoCommit(boolean b)
     Public setter for the 'autoCommit' flag.
 voidsetLastInsertId(long id)
    
public  StringtoString()
    

Field Detail
auth
String auth(Code)



autoCommit
boolean autoCommit(Code)



connLock
Object connLock(Code)



db
Database db(Code)



db_IS
Lock db_IS(Code)



db_IX
Lock db_IX(Code)



file
BlockFile file(Code)



fileLock
Object fileLock(Code)



id
int id(Code)



isClosed
boolean isClosed(Code)



lastId
static int lastId(Code)



lastInsertId
long lastInsertId(Code)



nextSession
int nextSession(Code)



random
Random random(Code)



readOnly
boolean readOnly(Code)



rlocks
Hashtable rlocks(Code)



sessions
List sessions(Code)



trans
Transaction trans(Code)



transAborted
boolean transAborted(Code)



transContext
Hashtable transContext(Code)



transId
long transId(Code)



wlocks
Hashtable wlocks(Code)



writeLog
boolean writeLog(Code)




Constructor Detail
Connection
public Connection(Database db, String auth, String passwd) throws SQLException(Code)
Construct a new connection for the specified database with the specified authorization
Parameters:
  db - the database
Parameters:
  user - the authorization id
Parameters:
  passwd - the password
exception:
  SQLException - thrown if bad authorization




Method Detail
abort
public void abort(Transaction t) throws IOException(Code)
TransactionObserver implementation: abort the current transaction



checkAborted
final void checkAborted() throws SQLException(Code)



close
final public void close() throws SQLException, IOException(Code)
Close this connection. Close all statement sessions and end the transaction.



closeSessions
final void closeSessions()(Code)
Close all the sessions in the table



countDots
final static int countDots(String name)(Code)
Return the number of '.' delimiters in this identifier, skipping over any occurrences of '.' within delimted identifiers (i.e., literal strings surrounded by double quotes.)



createSession
final public Session createSession() throws IOException, SQLException(Code)
Create a new session and store it in the session table.



endStatement
void endStatement(Session session, boolean abort) throws IOException, SQLException(Code)
At statement end, if autoCommit is TRUE, we commit (or rollback) the transaction



endTransaction
final public void endTransaction() throws IOException, SQLException(Code)
Commit the current transaction PRE: cursors closed, statements finished. POST: transaction commit/rollback, locks released



finishContexts
final void finishContexts() throws SQLException, IOException(Code)
Each context object represents some state retained on behalf of a constraint. The 'finish()' method of the context is used to perform any constraint-specific processing at the end of a statement/transaction.



getAuth
final public String getAuth()(Code)



getAutoCommit
final public boolean getAutoCommit()(Code)
Public accessor for the 'autoCommit' flag.



getContext
final StatementContext getContext(Object obj)(Code)
Return a saved context



getDatabase
final public Database getDatabase()(Code)
Accessor for my database



getDbLock
final Lock getDbLock(int mode) throws IOException, SQLException(Code)
Get the database root lock in the specified mode.



getFile
final public BlockFile getFile()(Code)
Accessor for my file



getLabel
public String getLabel()(Code)



getLastInsertId
long getLastInsertId()(Code)



getRandom
Random getRandom()(Code)
Accessor for my 'Random' object



getSession
final Session getSession(int i)(Code)



getTableReadLock
final void getTableReadLock(String tableName) throws SQLException, IOException(Code)
Helper routine to obtain a read lock on the specified table



getTableWriteLock
final void getTableWriteLock(String tableName) throws SQLException, IOException(Code)
Helper routine to obtain a write lock on the specified table



getTempFile
final BlockFile getTempFile(boolean holdRef) throws IOException(Code)
The BLOB code (InsertBlob) needs access to the temp file.



getTransaction
final public Transaction getTransaction()(Code)
Return the current transaction



getTransactionId
final public long getTransactionId()(Code)
Return the current transaction id as a long.



inRecovery
final boolean inRecovery() throws IOException(Code)
Access to 'recovery' flag



isClosed
public boolean isClosed()(Code)
Return true if this compare is closed



isReadOnly
public boolean isReadOnly()(Code)
Return true if this connection is read-only



makeTempTree
final Btree makeTempTree(Comparator compare) throws IOException(Code)
Make a new (temporary) btree structure in the current database.



makeTempTree
final Btree makeTempTree() throws IOException(Code)



makeTransaction
final Transaction makeTransaction() throws SQLException(Code)
Return (lazy create) the current Transaction



putContext
final void putContext(Object key, StatementContext val)(Code)
Add a new statement context



releaseLocks
final void releaseLocks()(Code)
At transaction end, release our cached locks. PRECONDITION: connLock monitor entered



removeSession
final public void removeSession(Session session)(Code)



resolveColname
final String resolveColname(String name, Tuple cursorTuple)(Code)
Return a fully qualified column name. Column: ..



resolveName
final String resolveName(String name)(Code)
Given a SQL ID, attempt to generate a fully qualified name by prepending the current schema name.



rollbackStatement
final void rollbackStatement(Session s) throws IOException, SQLException(Code)
Statement rollback



rollbackTransaction
final public void rollbackTransaction() throws IOException, SQLException(Code)
Roll back this transaction. Toss the pending lists (and statement contexts, right? XXX), close any cursors and get the database to undo anything we've actually done to the database.



setAuth
final public void setAuth(String auth, String passwd) throws SQLException(Code)
Set the current authorization code



setAutoCommit
final public void setAutoCommit(boolean b)(Code)
Public setter for the 'autoCommit' flag.



setLastInsertId
void setLastInsertId(long id)(Code)



toString
public String toString()(Code)



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.