Java Doc for JdbcConnection.java in  » Database-DBMS » h2database » org » h2 » jdbc » 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 » h2database » org.h2.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.h2.message.TraceObject
      org.h2.jdbc.JdbcConnection

JdbcConnection
public class JdbcConnection extends TraceObject implements Connection(Code)
Represents a connection (session) to a database.



Constructor Summary
public  JdbcConnection(String url, Properties info)
    
public  JdbcConnection(ConnectionInfo ci, boolean useBaseDir)
    
public  JdbcConnection(SessionInterface session, String user, String url)
    

Method Summary
 voidcheckClosed()
    
public  voidclearWarnings()
     Clears all warnings.
public  voidclose()
     Closes this connection.
public  voidcloseConnection()
    
public synchronized  voidcommit()
     Commits the current transaction.
public  BlobcreateBlob()
     Create a new empty Blob object.
 ValuecreateBlob(InputStream x, long length)
    
public  ClobcreateClob()
     Create a new empty Clob object.
 ValuecreateClob(Reader x, long length)
     [Not supported] Checks if unwrap can return an object of this class.
public  StatementcreateStatement()
     Creates a new statement.
public  StatementcreateStatement(int resultSetType, int resultSetConcurrency)
     Creates a statement with the specified result set type and concurrency.
public  StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
     Creates a statement with the specified result set type, concurrency, and holdability.
protected  voidfinalize()
    
public synchronized  booleangetAutoCommit()
     Gets the current setting for auto commit.
public  StringgetCatalog()
     Gets the current catalog name.
public  StringgetClientInfo(String name)
     [Not supported] Set a client property.
 ResultInterfacegetGeneratedKeys(JdbcStatement statement, int id)
    
public  intgetHoldability()
     Returns the current result set holdability.
public  DatabaseMetaDatagetMetaData()
     Gets the database meta data for this database.
public  intgetPowerOffCount()
    
public  intgetQueryTimeout()
    
public  SessionInterfacegetSession()
    
public  intgetTransactionIsolation()
     Returns the current transaction isolation level.
public  MapgetTypeMap()
     Gets the type map.
 StringgetURL()
    
 StringgetUser()
    
public  SQLWarninggetWarnings()
     Gets the first warning reported by calls on this object.
public  booleanisClosed()
     Returns true if this connection has been closed.
public  booleanisReadOnly()
     Returns true if the database is read-only.
public synchronized  booleanisValid(int timeout)
     Returns true if this connection is still valid.
public  StringnativeSQL(String sql)
     Translates a SQL statement into the database grammar.
 PreparedStatementprepareAutoCloseStatement(String sql)
    
public  CallableStatementprepareCall(String sql)
     Creates a new callable statement.
public  CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency)
     Creates a callable statement with the specified result set type and concurrency.
public  CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
     Creates a callable statement with the specified result set type, concurrency, and holdability.
 CommandInterfaceprepareCommand(String sql, int fetchSize)
    
 CommandInterfaceprepareCommand(String sql, CommandInterface old)
    
public  PreparedStatementprepareStatement(String sql)
     Creates a new prepared statement.
public  PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)
     Creates a prepared statement with the specified result set type and concurrency.
public  PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
     Creates a prepared statement with the specified result set type, concurrency, and holdability.
public  PreparedStatementprepareStatement(String sql, int autoGeneratedKeys)
     Creates a new prepared statement.
public  PreparedStatementprepareStatement(String sql, int[] columnIndexes)
     Creates a new prepared statement.
public  PreparedStatementprepareStatement(String sql, String[] columnNames)
     Creates a new prepared statement.
public  voidreleaseSavepoint(Savepoint savepoint)
     Releases a savepoint.
public synchronized  voidrollback()
     Rolls back the current transaction.
public  voidrollback(Savepoint savepoint)
     Rolls back to a savepoint.
public synchronized  voidsetAutoCommit(boolean autoCommit)
     Switches auto commit on or off.
public  voidsetCatalog(String catalog)
     Set the default catalog name.
public  voidsetExecutingStatement(Statement stat)
    
public  voidsetHoldability(int holdability)
     Changes the current result set holdability.
public  voidsetJdbcConnectionListener(JdbcConnectionListener listener)
    
public  voidsetPowerOffCount(int count)
    
public  voidsetQueryTimeout(int seconds)
    
public  voidsetReadOnly(boolean readOnly)
     According to the JDBC specs, this setting is only a hint to the database to enable optimizations - it does not cause writes to be prohibited.
public  SavepointsetSavepoint()
     Creates a new unnamed savepoint.
public  SavepointsetSavepoint(String name)
     Creates a new named savepoint.
public  voidsetTransactionIsolation(int level)
     Changes the current transaction isolation level.
public  voidsetTypeMap(Map map)
     [Partially supported] Sets the type map.
public  StringtoString()
    
 StringtranslateSQL(String sql)
    


Constructor Detail
JdbcConnection
public JdbcConnection(String url, Properties info) throws SQLException(Code)
INTERNAL



JdbcConnection
public JdbcConnection(ConnectionInfo ci, boolean useBaseDir) throws SQLException(Code)
INTERNAL



JdbcConnection
public JdbcConnection(SessionInterface session, String user, String url) throws SQLException(Code)
INTERNAL




Method Detail
checkClosed
void checkClosed() throws SQLException(Code)



clearWarnings
public void clearWarnings() throws SQLException(Code)
Clears all warnings.



close
public void close() throws SQLException(Code)
Closes this connection. All open statements, prepared statements and result sets that where created by this connection become invalid after calling this method. If there is an uncommitted transaction, it will be rolled back.



closeConnection
public void closeConnection() throws SQLException(Code)
INTERNAL



commit
public synchronized void commit() throws SQLException(Code)
Commits the current transaction. This call has only an effect if auto commit is switched off.
throws:
  SQLException - if the connection is closed



createBlob
public Blob createBlob() throws SQLException(Code)
Create a new empty Blob object. the object



createBlob
Value createBlob(InputStream x, long length) throws SQLException(Code)



createClob
public Clob createClob() throws SQLException(Code)
Create a new empty Clob object. the object



createClob
Value createClob(Reader x, long length) throws SQLException(Code)
[Not supported] Checks if unwrap can return an object of this class.
Parameters:
  iface - the class



createStatement
public Statement createStatement() throws SQLException(Code)
Creates a new statement. the new statement
throws:
  SQLException - if the connection is closed



createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException(Code)
Creates a statement with the specified result set type and concurrency. the statement
throws:
  SQLException - if the connection is closed or the result set type orconcurrency are not supported



createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code)
Creates a statement with the specified result set type, concurrency, and holdability. the statement
throws:
  SQLException - if the connection is closed or the result set type,concurrency, or holdability are not supported



finalize
protected void finalize()(Code)



getAutoCommit
public synchronized boolean getAutoCommit() throws SQLException(Code)
Gets the current setting for auto commit. true for on, false for off
throws:
  SQLException - if the connection is closed



getCatalog
public String getCatalog() throws SQLException(Code)
Gets the current catalog name.
throws:
  SQLException - if the connection is closed



getClientInfo
public String getClientInfo(String name) throws SQLException(Code)
[Not supported] Set a client property.



getGeneratedKeys
ResultInterface getGeneratedKeys(JdbcStatement statement, int id) throws SQLException(Code)



getHoldability
public int getHoldability() throws SQLException(Code)
Returns the current result set holdability. the holdability
throws:
  SQLException - if the connection is closed



getMetaData
public DatabaseMetaData getMetaData() throws SQLException(Code)
Gets the database meta data for this database. the database meta data
throws:
  SQLException - if the connection is closed



getPowerOffCount
public int getPowerOffCount()(Code)
INTERNAL



getQueryTimeout
public int getQueryTimeout() throws SQLException(Code)
INTERNAL



getSession
public SessionInterface getSession()(Code)
INTERNAL



getTransactionIsolation
public int getTransactionIsolation() throws SQLException(Code)
Returns the current transaction isolation level. the isolation level.
throws:
  SQLException - if the connection is closed



getTypeMap
public Map getTypeMap() throws SQLException(Code)
Gets the type map. null
throws:
  SQLException - if the connection is closed



getURL
String getURL() throws SQLException(Code)



getUser
String getUser() throws SQLException(Code)



getWarnings
public SQLWarning getWarnings() throws SQLException(Code)
Gets the first warning reported by calls on this object. null



isClosed
public boolean isClosed() throws SQLException(Code)
Returns true if this connection has been closed. true if close was called



isReadOnly
public boolean isReadOnly() throws SQLException(Code)
Returns true if the database is read-only. if the database is read-only
throws:
  SQLException - if the connection is closed



isValid
public synchronized boolean isValid(int timeout)(Code)
Returns true if this connection is still valid. true if the connection is valid.



nativeSQL
public String nativeSQL(String sql) throws SQLException(Code)
Translates a SQL statement into the database grammar. the translated statement
throws:
  SQLException - if the connection is closed



prepareAutoCloseStatement
PreparedStatement prepareAutoCloseStatement(String sql) throws SQLException(Code)



prepareCall
public CallableStatement prepareCall(String sql) throws SQLException(Code)
Creates a new callable statement. the callable statement
throws:
  SQLException - if the connection is closed or the statement is not valid



prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code)
Creates a callable statement with the specified result set type and concurrency. the callable statement
throws:
  SQLException - if the connection is closed or the result set type orconcurrency are not supported



prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code)
Creates a callable statement with the specified result set type, concurrency, and holdability. the callable statement
throws:
  SQLException - if the connection is closed or the result set type,concurrency, or holdability are not supported



prepareCommand
CommandInterface prepareCommand(String sql, int fetchSize) throws SQLException(Code)



prepareCommand
CommandInterface prepareCommand(String sql, CommandInterface old) throws SQLException(Code)



prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException(Code)
Creates a new prepared statement. the prepared statement
throws:
  SQLException - if the connection is closed



prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code)
Creates a prepared statement with the specified result set type and concurrency. the prepared statement
throws:
  SQLException - if the connection is closed or the result set type orconcurrency are not supported



prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code)
Creates a prepared statement with the specified result set type, concurrency, and holdability. the prepared statement
throws:
  SQLException - if the connection is closed or the result set type,concurrency, or holdability are not supported



prepareStatement
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException(Code)
Creates a new prepared statement. This method just calls prepareStatement(String sql). the prepared statement
throws:
  SQLException - if the connection is closed



prepareStatement
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException(Code)
Creates a new prepared statement. This method just calls prepareStatement(String sql). the prepared statement
throws:
  SQLException - if the connection is closed



prepareStatement
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException(Code)
Creates a new prepared statement. This method just calls prepareStatement(String sql). the prepared statement
throws:
  SQLException - if the connection is closed



releaseSavepoint
public void releaseSavepoint(Savepoint savepoint) throws SQLException(Code)
Releases a savepoint.



rollback
public synchronized void rollback() throws SQLException(Code)
Rolls back the current transaction. This call has only an effect if auto commit is switched off.
throws:
  SQLException - if the connection is closed



rollback
public void rollback(Savepoint savepoint) throws SQLException(Code)
Rolls back to a savepoint.



setAutoCommit
public synchronized void setAutoCommit(boolean autoCommit) throws SQLException(Code)
Switches auto commit on or off. Calling this function does not commit the current transaction.
Parameters:
  autoCommit - true for auto commit on, false for off
throws:
  SQLException - if the connection is closed



setCatalog
public void setCatalog(String catalog) throws SQLException(Code)
Set the default catalog name. This call is ignored.
throws:
  SQLException - if the connection is closed



setExecutingStatement
public void setExecutingStatement(Statement stat)(Code)
INTERNAL



setHoldability
public void setHoldability(int holdability) throws SQLException(Code)
Changes the current result set holdability.
Parameters:
  holdability - ResultSet.HOLD_CURSORS_OVER_COMMIT orResultSet.CLOSE_CURSORS_AT_COMMIT;
throws:
  SQLException - if the connection is closed or the holdability is notsupported



setJdbcConnectionListener
public void setJdbcConnectionListener(JdbcConnectionListener listener)(Code)
INTERNAL



setPowerOffCount
public void setPowerOffCount(int count) throws SQLException(Code)
INTERNAL



setQueryTimeout
public void setQueryTimeout(int seconds) throws SQLException(Code)
INTERNAL



setReadOnly
public void setReadOnly(boolean readOnly) throws SQLException(Code)
According to the JDBC specs, this setting is only a hint to the database to enable optimizations - it does not cause writes to be prohibited.
throws:
  SQLException - if the connection is closed



setSavepoint
public Savepoint setSavepoint() throws SQLException(Code)
Creates a new unnamed savepoint. the new savepoint



setSavepoint
public Savepoint setSavepoint(String name) throws SQLException(Code)
Creates a new named savepoint. the new savepoint



setTransactionIsolation
public void setTransactionIsolation(int level) throws SQLException(Code)
Changes the current transaction isolation level. Calling this method will commit an open transaction, even if the new level is the same as the old one, except if the level is not supported.
Parameters:
  level - the new transaction isolation level,Connection.TRANSACTION_READ_UNCOMMITTED,Connection.TRANSACTION_READ_COMMITTED, orConnection.TRANSACTION_SERIALIZABLE
throws:
  SQLException - if the connection is closed or the isolation levelis not supported



setTypeMap
public void setTypeMap(Map map) throws SQLException(Code)
[Partially supported] Sets the type map. This is only supported if the map is empty or null.



toString
public String toString()(Code)
INTERNAL



translateSQL
String translateSQL(String sql) throws SQLException(Code)



Fields inherited from org.h2.message.TraceObject
final public static int CALLABLE_STATEMENTCONNECTIONDATABASE_META_DATAPREPARED_STATEMENTRESULT_SETRESULT_SET_META_DATASAVEPOINTSQL_EXCEPTIONSTATEMENTBLOBCLOBPARAMETER_META_DATA(Code)(Java Doc)
final public static int DATA_SOURCEXA_DATA_SOURCEXIDARRAY(Code)(Java Doc)

Methods inherited from org.h2.message.TraceObject
protected boolean debug()(Code)(Java Doc)
protected void debugCode(String text)(Code)(Java Doc)
protected void debugCodeAssign(String className, int type, int id, String value)(Code)(Java Doc)
protected void debugCodeCall(String text)(Code)(Java Doc)
protected void debugCodeCall(String text, long param)(Code)(Java Doc)
protected void debugCodeCall(String text, String param)(Code)(Java Doc)
protected int getNextId(int type)(Code)(Java Doc)
protected Trace getTrace()(Code)(Java Doc)
protected int getTraceId()(Code)(Java Doc)
public String getTraceObjectName()(Code)(Java Doc)
protected boolean info()(Code)(Java Doc)
protected SQLException logAndConvert(Throwable e)(Code)(Java Doc)
protected String quote(String s)(Code)(Java Doc)
protected String quoteArray(String[] s)(Code)(Java Doc)
protected String quoteBigDecimal(BigDecimal x)(Code)(Java Doc)
protected String quoteBytes(byte[] x)(Code)(Java Doc)
protected String quoteDate(java.sql.Date x)(Code)(Java Doc)
protected String quoteIntArray(int[] s)(Code)(Java Doc)
protected String quoteMap(Map map)(Code)(Java Doc)
protected String quoteTime(java.sql.Time x)(Code)(Java Doc)
protected String quoteTimestamp(java.sql.Timestamp x)(Code)(Java Doc)
protected void setTrace(Trace trace, int type, int id)(Code)(Java Doc)
public static String toString(String sql, ObjectArray params)(Code)(Java Doc)

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.