jodd.db
Class DbUtil

java.lang.Object
  extended by jodd.db.DbUtil

public class DbUtil
extends java.lang.Object

Various DB utilities.


Constructor Summary
DbUtil()
           
 
Method Summary
static void close(java.sql.ResultSet resultSet)
          Closes result set safely without throwing an exception.
static void close(java.sql.Statement statement)
          Closes statement safely without throwing an exception.
static int getFirstInt(java.sql.ResultSet resultSet)
          Returns int value of very first column in result set.
static long getFirstLong(java.sql.ResultSet resultSet)
          Returns long value of very first column in result set.
static void setPreparedStatementObject(java.sql.PreparedStatement preparedStatement, int index, java.lang.Object value, int targetSqlType)
          Sets prepared statement object using target SQL type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbUtil

public DbUtil()
Method Detail

close

public static void close(java.sql.Statement statement)
Closes statement safely without throwing an exception.


close

public static void close(java.sql.ResultSet resultSet)
Closes result set safely without throwing an exception.


getFirstLong

public static long getFirstLong(java.sql.ResultSet resultSet)
                         throws java.sql.SQLException
Returns long value of very first column in result set.

Throws:
java.sql.SQLException

getFirstInt

public static int getFirstInt(java.sql.ResultSet resultSet)
                       throws java.sql.SQLException
Returns int value of very first column in result set.

Throws:
java.sql.SQLException

setPreparedStatementObject

public static void setPreparedStatementObject(java.sql.PreparedStatement preparedStatement,
                                              int index,
                                              java.lang.Object value,
                                              int targetSqlType)
                                       throws java.sql.SQLException
Sets prepared statement object using target SQL type. Here Jodd makes conversion and not JDBC driver.

Throws:
java.sql.SQLException


Copyright © 2003-2013 Jodd Team