|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiz.wedoit4u.databeans.DatabaseHelper
public final class DatabaseHelper
A helper class that provides convenient methods to interact with
a backend database. All methods are static and hence
no constructor is provided to initialise this class.
Copyright 2003, Rakesh Vidyadharan and wedoit4u.biz
| Field Summary | |
|---|---|
private static javax.sql.DataSource |
dataSource
A reference to the DataSource to be used to fetch
connections from the application server's context. |
private static java.lang.String |
WEDOIT4U_JNDI_LOCATION
The JNDI location for the DataSource
that represents the wedoit4u database schema. |
| Constructor Summary | |
|---|---|
private |
DatabaseHelper()
Default constructor. |
| Method Summary | |
|---|---|
static java.sql.Connection |
getConnection()
Fetch a Connection from the dataSource
obtained from the WEDOIT4U_JNDI_LOCATION in the
application server context. |
static int |
getNextSequenceValue(java.lang.String sequence)
Return the next value of the specified sequence. |
static void |
writeToClob(oracle.sql.CLOB clob,
java.lang.String content)
Update the specified CLOB object with the contents
in the string passed in. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String WEDOIT4U_JNDI_LOCATION
JNDI location for the DataSource
that represents the wedoit4u database schema.
private static javax.sql.DataSource dataSource
DataSource to be used to fetch
connections from the application server's context.
| Constructor Detail |
|---|
private DatabaseHelper()
| Method Detail |
|---|
public static final java.sql.Connection getConnection()
throws javax.naming.NamingException,
java.sql.SQLException
Connection from the dataSource
obtained from the WEDOIT4U_JNDI_LOCATION in the
application server context.
javax.naming.NamingException - - If errors are encountered while fetching
the JNDI location from the application server context.
java.sql.SQLException - - If errors are encountered while fetching
a connection from the data source.
public static final int getNextSequenceValue(java.lang.String sequence)
throws java.sql.SQLException,
javax.naming.NamingException
sequence - - The name of the sequence whose next value
is to be retrieved.
java.sql.SQLException - - If any errors are encountered while fetching
the sequence value.
javax.naming.NamingException - - If any errors are encountered while
fetching a reference to the database data source.
public static final void writeToClob(oracle.sql.CLOB clob,
java.lang.String content)
throws java.io.IOException,
java.sql.SQLException
CLOB object with the contents
in the string passed in. This method uses the Oracle
specific writing to clob fields process.
clob - - The clob column that is to be
modified.content - - The new content that is to be written to
the CLOB field.
java.io.IOException - - If exceptions are encountered while writing
to the clob object.
java.sql.SQLException - - If exceptions are encountered while
truncating the existing content in the clob field.
|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||