## de.ix.jspTutorial.database
Class DatabaseConnection

    java.lang.Object
      |
      +--de.ix.jspTutorial.database.DatabaseConnection

public class DatabaseConnection
extends java.lang.Object

Verbindung zur Datenbank.

Version:
  $Id:$
Author:
  Peter Rossbach (pr@webapp.de)

Field Summary
`private java.sql.Connection` `myConnection` JDBC connection object
`private java.lang.String` `myConnectionString` URL to use when connecting via the given driver
`private java.lang.String` `myDatabaseDriver` Driver object name to use for JDBC connection
`private java.lang.String` `myDescription` Description of this connection
`private boolean` `myIsConnected` Is this connection object actually connected to the database yet?
`private long` `myLastUsed` When was this connection last used?
`private java.util.Properties` `myProperties` Parameter to connect to the database
`static java.lang.String` `vcid` Version des Source

Constructor Summary
`private` `DatabaseConnection()`
`` `DatabaseConnection(java.lang.String aDatabaseDriver, java.lang.String aConnectionString)`
`` `DatabaseConnection(java.lang.String aDatabaseDriver, java.lang.String aConnectionString, java.lang.String aDescription)`

Method Summary
`boolean` `begin()`
`void` `commit()`
`void` `connect(java.util.Properties aProperties)`
`void` `connect(java.lang.String aLogin, java.lang.String aPassword)`
`java.sql.Statement` `createStatement()`
`void` `disconnect()`
`void` `finalize()`
`boolean` `getAutoCommit()`
`java.lang.String` `getConnectionString()`
`java.lang.String` `getDatabaseDriver()`
`java.lang.String` `getDescription()`
`long` `getLastUsed()`
`java.lang.String` `getLogin()`
`java.lang.String` `getPassword()`
`boolean` `isConnected()`
`java.lang.String` `nativeSQL(java.lang.String sql)`
`java.sql.CallableStatement` `prepareCall(java.lang.String sql)`
`java.sql.PreparedStatement` `prepareStatement(java.lang.String sql)`
`void` `rollback()`
`void` `setAutoCommit(boolean autoCommit)`
`void` `setDescription(java.lang.String newDescription)`
`private void` `used()`

Methods inherited from class java.lang.Object
`<clinit>, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait`

Field Detail

### vcid

    public static java.lang.String vcid

  Version des Source

### myDatabaseDriver

    private java.lang.String myDatabaseDriver

  Driver object name to use for JDBC connection

### myConnectionString

    private java.lang.String myConnectionString

  URL to use when connecting via the given driver

### myDescription

    private java.lang.String myDescription

  Description of this connection

### myIsConnected

    private boolean myIsConnected

  Is this connection object actually connected to the database yet?

### myConnection

    private java.sql.Connection myConnection

  JDBC connection object

### myProperties

    private java.util.Properties myProperties

  Parameter to connect to the database

### myLastUsed

    private long myLastUsed

  When was this connection last used?

Constructor Detail

### DatabaseConnection

    private DatabaseConnection()

### DatabaseConnection

    public DatabaseConnection(java.lang.String aDatabaseDriver,
                              java.lang.String aConnectionString)
                       throws DatabaseException

### DatabaseConnection

    public DatabaseConnection(java.lang.String aDatabaseDriver,
                              java.lang.String aConnectionString,
                              java.lang.String aDescription)
                       throws DatabaseException

Method Detail

### isConnected

    public boolean isConnected()

### getLastUsed

    public long getLastUsed()

### used

    private void used()

### setDescription

    public void setDescription(java.lang.String newDescription)

### getDescription

    public java.lang.String getDescription()

### getConnectionString

    public java.lang.String getConnectionString()

### getLogin

    public java.lang.String getLogin()

### getPassword

    public java.lang.String getPassword()

### getDatabaseDriver

    public java.lang.String getDatabaseDriver()

### connect

    public void connect(java.lang.String aLogin,
                        java.lang.String aPassword)
                 throws DatabaseException

### connect

    public void connect(java.util.Properties aProperties)
                 throws DatabaseException

### disconnect

    public void disconnect()
                    throws DatabaseException

### finalize

    public void finalize()

  Overrides:
    finalize in class java.lang.Object

### begin

    public boolean begin()
                  throws DatabaseException

### commit

    public void commit()
                throws DatabaseException

### rollback

    public void rollback()
                  throws DatabaseException

### nativeSQL

    public java.lang.String nativeSQL(java.lang.String sql)
                               throws java.sql.SQLException

### createStatement

    public java.sql.Statement createStatement()
                                       throws java.sql.SQLException

### prepareCall

    public java.sql.CallableStatement prepareCall(java.lang.String sql)
                                           throws java.sql.SQLException

### prepareStatement

    public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                                throws java.sql.SQLException

### setAutoCommit

    public void setAutoCommit(boolean autoCommit)
                       throws java.sql.SQLException

### getAutoCommit

    public boolean getAutoCommit()
                          throws java.sql.SQLException

~ Das iX JSP Tutorial III - © 2000 by Peter Roßbach ~