Dashboard Builder Commons 6.0.0.Beta4

org.jboss.dashboard.database
Class NonPooledDataSource

java.lang.Object
  extended by org.jboss.dashboard.database.NonPooledDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource

public class NonPooledDataSource
extends Object
implements DataSource

A data source implementation that bounds every connection to the underlying thread.


Field Summary
protected  Map<Class,Class[]> _classInterfacesMap
          A cache of java class interfaces
protected  boolean autoCommit
           
protected  String driver
           
protected  int isolation
           
protected  int loginTimeOut
           
protected  String password
           
protected  PrintWriter printWriter
           
protected  String url
           
protected  String user
           
 
Constructor Summary
NonPooledDataSource()
           
 
Method Summary
 Connection createConnectionProxy(Connection conn)
           
protected  Statement createPreparedStatementProxy(PreparedStatement stmt, String sql)
           
protected  Statement createStatementProxy(Statement stmt)
           
protected  boolean getAutoCommit(Connection conn)
           
protected  Class[] getClassInterfaces(Class clazz)
           
 Connection getConnection()
           
 Connection getConnection(String username, String password)
           
 String getDriver()
           
 int getIsolation()
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 Logger getParentLogger()
           
 String getPassword()
           
 String getUrl()
           
 String getUser()
           
 boolean isAutoCommit()
           
 boolean isWrapperFor(Class<?> iface)
           
 void setAutoCommit(boolean autoCommit)
           
protected  void setAutoCommit(Connection conn, boolean autocommit)
           
 void setDriver(String driver)
           
protected  void setIsolation(Connection conn, int isolation)
           
 void setIsolation(int isolation)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 void setPassword(String password)
           
 void setUrl(String url)
           
 void setUser(String user)
           
<T> T
unwrap(Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

printWriter

protected PrintWriter printWriter

loginTimeOut

protected int loginTimeOut

url

protected String url

user

protected String user

password

protected String password

driver

protected String driver

isolation

protected int isolation

autoCommit

protected boolean autoCommit

_classInterfacesMap

protected transient Map<Class,Class[]> _classInterfacesMap
A cache of java class interfaces

Constructor Detail

NonPooledDataSource

public NonPooledDataSource()
Method Detail

getUrl

public String getUrl()

setUrl

public void setUrl(String url)

getUser

public String getUser()

setUser

public void setUser(String user)

getPassword

public String getPassword()

setPassword

public void setPassword(String password)

getDriver

public String getDriver()

setDriver

public void setDriver(String driver)

getIsolation

public int getIsolation()

setIsolation

public void setIsolation(int isolation)

isAutoCommit

public boolean isAutoCommit()

setAutoCommit

public void setAutoCommit(boolean autoCommit)

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface CommonDataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface CommonDataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Specified by:
unwrap in interface Wrapper
Throws:
SQLException

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getParentLogger

public Logger getParentLogger()

getAutoCommit

protected boolean getAutoCommit(Connection conn)

setAutoCommit

protected void setAutoCommit(Connection conn,
                             boolean autocommit)

setIsolation

protected void setIsolation(Connection conn,
                            int isolation)

createConnectionProxy

public Connection createConnectionProxy(Connection conn)
                                 throws SQLException
Throws:
SQLException

getClassInterfaces

protected Class[] getClassInterfaces(Class clazz)

createStatementProxy

protected Statement createStatementProxy(Statement stmt)
                                  throws SQLException
Throws:
SQLException

createPreparedStatementProxy

protected Statement createPreparedStatementProxy(PreparedStatement stmt,
                                                 String sql)
                                          throws SQLException
Throws:
SQLException

Dashboard Builder Commons 6.0.0.Beta4

Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.