|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jsp.dbutil.ConnBean
A Bean to open a database connection. Can enable statement caching and set properties like Row Prefetch and Execute Update Batch Size. Mechanism to create all kinds of statements is also provided.
Bean Properties that can be set and retrieved :
Field Summary | |
protected java.sql.Connection |
m_conn
|
Constructor Summary | |
ConnBean()
|
Method Summary | |
void |
close()
Close the database connection and any opened cursors. |
void |
connect()
Establish a database connection with the user name, password and URL set before. |
java.sql.Connection |
getConnection()
Get the underlying connection object. |
CursorBean |
getCursorBean(int stype,
java.lang.String sql)
Creates a cursor and returns a CursorBean. |
int |
getExecuteBatch()
Get the execute batch size for this connection bean. |
java.lang.String |
getPassword()
Get the password for this connection bean. |
int |
getPreFetch()
Get the Row prefetch size for this connection bean. |
int |
getStmtCacheSize()
Get the statement cache size set for this connection bean. |
java.lang.String |
getURL()
Get the URL for this connection bean. |
java.lang.String |
getUser()
Get the user name for this connection bean. |
void |
outOfScope(JspScopeEvent ae)
Invoked when a JSP scope that this object is attached to is ending. |
void |
setExecuteBatch(int bsize)
Set the Execute Batch Size for DMLs. |
void |
setPassword(java.lang.String password)
Set the password with which connections have to be obtained. |
void |
setPreFetch(int prefSize)
Set the Row prefetch size for the rows returned for queries. |
void |
setStmtCacheSize(int scsize)
Enable and set the statement cache size. |
void |
setURL(java.lang.String url)
Set the URL from which connections have to be obtained. |
void |
setUser(java.lang.String user)
Set the user name with which connections have to be obtained. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.sql.Connection m_conn
Constructor Detail |
public ConnBean()
Method Detail |
public void setUser(java.lang.String user)
user
- Username to be set.public java.lang.String getUser()
public void setPassword(java.lang.String password)
password
- Passowrd to be set.public java.lang.String getPassword()
public void setURL(java.lang.String url)
url
- URL to be set.public java.lang.String getURL()
public void connect() throws java.sql.SQLException
public void close() throws java.sql.SQLException
public java.sql.Connection getConnection()
public CursorBean getCursorBean(int stype, java.lang.String sql) throws java.sql.SQLException
stype
- Statement Type. Possible values are
sql
- Sql string to be executedpublic void setPreFetch(int prefSize)
prefSize
- prefetch sizepublic int getPreFetch()
Returns 10 (default) if not set.
public void setExecuteBatch(int bsize)
bsize
- Execute Batch Sizepublic int getExecuteBatch()
Returns 1 (default) if not set.
public void setStmtCacheSize(int scsize) throws java.sql.SQLException
scsize
- Statement Cache Sizepublic int getStmtCacheSize()
public void outOfScope(JspScopeEvent ae)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |