|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dbforms.util.SqlUtil
public class SqlUtil
this utility-class provides convenience methods for SQL related tasks
Constructor Summary | |
---|---|
SqlUtil()
|
Method Summary | |
---|---|
static void |
closeConnection(Connection con)
Close the input connection |
static void |
logSqlException(SQLException e)
Log the SQLException stacktrace and do the same for all the nested exceptions. |
static void |
logSqlException(SQLException e,
String desc)
Log the SQLException stacktrace (adding the input description to the first log statement) and do the same for all the nested exceptions. |
static InputStream |
readDbFieldBlob(ResultSet rs)
Read the database field and write to the client its content |
static FileInputStream |
readDiskBlob(String fileName,
String directory,
String defVal)
Read the blob field from the filesystem and write to the client its content. |
static FileHolder |
readFileHolderBlob(ResultSet rs)
Read the database field and write to the client its content |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SqlUtil()
Method Detail |
---|
public static final void closeConnection(Connection con)
con
- the connection to closepublic static final void logSqlException(SQLException e, String desc)
e
- the SQL exception to logdesc
- the exception descriptionpublic static final void logSqlException(SQLException e)
e
- the SQL exception to logpublic static FileHolder readFileHolderBlob(ResultSet rs) throws IOException, SQLException
rs
- Description of the ParameterfileName
- is the filename or NULL in the classic (Fileholder-based) BLOB
handling
IOException
- Description of the Exception
SQLException
- Description of the Exceptionpublic static InputStream readDbFieldBlob(ResultSet rs) throws IOException, SQLException
rs
- Description of the ParameterfileName
- is the filename or NULL in the classic (Fileholder-based) BLOB
handling
IOException
- Description of the Exception
SQLException
- Description of the Exceptionpublic static FileInputStream readDiskBlob(String fileName, String directory, String defVal) throws FileNotFoundException, IOException
fileName
- Description of the Parameterdirectory
- Description of the ParameterdefVal
- Default value of the file tag
FileNotFoundException
- Description of the Exception
IOException
- Description of the Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |