HiRISE

HiRISE.HiReport.sql
Class SQL

java.lang.Object
  extended by HiRISE.HiReport.sql.SQL
Direct Known Subclasses:
Select

public class SQL
extends Object

Base class for SQL procedures


Nested Class Summary
static class SQL.Order
          Possible ordering
 
Constructor Summary
SQL()
           
 
Method Summary
protected  void bind(PreparedStatement pstmt, Constraint constraint, Column field)
          Bind a constraint
static Object get(ResultSet rs, Column col)
          Get the result for a column from a result set.
static Date getDate(ResultSet rs, Column col)
          Get a date field from a result set.
static double getDouble(ResultSet rs, Column col)
          Get a double field from a result set
static float getFloat(ResultSet rs, Column col)
          Get a float field from a result set
static int getInt(ResultSet rs, Column col)
          Get an integer field from a result set
static int getInteger(ResultSet rs, Column col)
          Get an integer field from a result set
static long getLong(ResultSet rs, Column col)
          Get a long integer field from a result set
static short getShort(ResultSet rs, Column col)
          Get a short integer field from a result set
static String getString(ResultSet rs, Column col)
          Get a String field from a result set
static Timestamp getTimestamp(ResultSet rs, Column col)
          Get a timestamp field from a result set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQL

public SQL()
Method Detail

bind

protected void bind(PreparedStatement pstmt,
                    Constraint constraint,
                    Column field)
             throws SQLException
Bind a constraint

Parameters:
pstmt - The statement
constraint - The constraint
field - The field
Throws:
SQLException - Failed to bind

getInteger

public static int getInteger(ResultSet rs,
                             Column col)
                      throws SQLException
Get an integer field from a result set

Parameters:
rs - query result
col - column
Returns:
field value
Throws:
SQLException - retrieval failed

getString

public static String getString(ResultSet rs,
                               Column col)
                        throws SQLException
Get a String field from a result set

Parameters:
rs - query result
col - column
Returns:
field value
Throws:
SQLException - retrieval failed

getShort

public static short getShort(ResultSet rs,
                             Column col)
                      throws SQLException
Get a short integer field from a result set

Parameters:
rs - query result
col - column
Returns:
field value
Throws:
SQLException - retrieval failed

getInt

public static int getInt(ResultSet rs,
                         Column col)
                  throws SQLException
Get an integer field from a result set

Parameters:
rs - query result
col - column
Returns:
field value
Throws:
SQLException - retrieval failed

getLong

public static long getLong(ResultSet rs,
                           Column col)
                    throws SQLException
Get a long integer field from a result set

Parameters:
rs - query result
col - column
Returns:
field value
Throws:
SQLException - retrieval failed

getFloat

public static float getFloat(ResultSet rs,
                             Column col)
                      throws SQLException
Get a float field from a result set

Parameters:
rs - query result
col - column
Returns:
field value
Throws:
SQLException - retrieval failed

getDouble

public static double getDouble(ResultSet rs,
                               Column col)
                        throws SQLException
Get a double field from a result set

Parameters:
rs - query result
col - column
Returns:
field value
Throws:
SQLException - retrieval failed

getDate

public static Date getDate(ResultSet rs,
                           Column col)
Get a date field from a result set. Handles malformed data.

Parameters:
rs - query result
col - column
Returns:
field value or null if malformed or retrieval failed

getTimestamp

public static Timestamp getTimestamp(ResultSet rs,
                                     Column col)
Get a timestamp field from a result set. Handles malformed data.

Parameters:
rs - query result
col - column
Returns:
field value or null if malformed or retrieval failed

get

public static Object get(ResultSet rs,
                         Column col)
                  throws SQLException
Get the result for a column from a result set.

Parameters:
rs - The result
col - The column
Returns:
The object, could be null
Throws:
SQLException - Could not get a value

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona