org.barracudamvc.testbed.workbench.jdbc
Class Database

java.lang.Object
  extended byorg.barracudamvc.testbed.workbench.jdbc.Database

public class Database
extends Object

Database - this is really a legacy class; we should be using JDBC 2.0 and getting a DataSource, but for now we'll leave it like it is, since after all it already works ;-)

Version:
1.0
Author:
Christian Cryder (csc)

Constructor Summary
Database(String ijdbcDriverName, String ijdbcServerURL, String idbUserName, String idbPassword)
          The public contructor for Database
 
Method Summary
 void commit()
          commit
 void connectServer()
          connectServer
 Statement createStatement()
          createStatement
 void disconnectServer()
          disconnectServer
 boolean getAutoCommit()
          getAutoCommit
 int getCommitLevel()
          getCommitLevel
 Connection getConnection()
          getConnection
 Connection getConnection(boolean verify)
          getConnection
 String getUserName()
          getUserName
 boolean isConnected()
          disconnectServer
 PreparedStatement prepareStatement(String s)
          disconnectServer
 void resetCommitLevel()
          resetCommitLevel
 void resetConnection()
          resetConnection
 void rollback()
          rollback
 void setAutoCommit(boolean val)
          setAutoCommit
 void setConnection(Connection c)
          setConnection
 void setUserName(String s)
          setUserName
 void verifyConnection()
          verifyConnection
 void verifyConnection(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Database

public Database(String ijdbcDriverName,
                String ijdbcServerURL,
                String idbUserName,
                String idbPassword)
The public contructor for Database

Parameters:
ijdbcDriverName - Jdbc Driver Name
ijdbcServerURL - Jdbc Server URL
idbUserName - Database User Name
idbPassword - Database password
Method Detail

connectServer

public void connectServer()
                   throws PropertyVetoException
connectServer

Throws:
PropertyVetoException

disconnectServer

public void disconnectServer()
                      throws PropertyVetoException
disconnectServer

Throws:
PropertyVetoException

isConnected

public boolean isConnected()
disconnectServer

Returns:
True if still connect to the database

prepareStatement

public PreparedStatement prepareStatement(String s)
                                   throws SQLException
disconnectServer

Parameters:
s - String to be set in the prepare statement
Returns:
PreparedStatement
Throws:
SQLException

createStatement

public Statement createStatement()
                          throws SQLException
createStatement

Returns:
Statement
Throws:
SQLException

getConnection

public Connection getConnection()
                         throws PropertyVetoException
getConnection

Returns:
Connection
Throws:
PropertyVetoException

getConnection

public Connection getConnection(boolean verify)
                         throws PropertyVetoException
getConnection

Parameters:
verify - Verify
Returns:
Connection
Throws:
PropertyVetoException

setConnection

public void setConnection(Connection c)
setConnection

Parameters:
c - Connection to be set
See Also:
Connection

verifyConnection

public void verifyConnection()
                      throws SQLException
verifyConnection

Throws:
SQLException

verifyConnection

public void verifyConnection(String s)
                      throws SQLException
Throws:
SQLException

resetConnection

public void resetConnection()
resetConnection


commit

public void commit()
            throws SQLException
commit

Throws:
SQLException

rollback

public void rollback()
              throws SQLException
rollback

Throws:
SQLException

resetCommitLevel

public void resetCommitLevel()
resetCommitLevel


getCommitLevel

public int getCommitLevel()
getCommitLevel


setAutoCommit

public void setAutoCommit(boolean val)
setAutoCommit

Parameters:
val - True if commited

getAutoCommit

public boolean getAutoCommit()
getAutoCommit

Returns:
True if commited

getUserName

public String getUserName()
getUserName

Returns:
User name

setUserName

public void setUserName(String s)
setUserName

Parameters:
s - User name to be set


Copyright © 2004 BarracudaMVC.org All Rights Reserved.