com.wm.app.tn.db
Class SQLWrappers

java.lang.Object
  extended by com.wm.app.tn.db.SQLWrappers

public class SQLWrappers
extends java.lang.Object


Field Summary
static short NORM_FORM_C
           
static short NORM_FORM_KC
           
static short NORM_NONE
           
 
Constructor Summary
SQLWrappers()
           
 
Method Summary
static void close(java.sql.Connection conn)
           
static void close(java.sql.ResultSet set)
           
static void close(java.sql.Statement stmt)
           
static void commit(java.sql.Connection conn)
           
static java.lang.Boolean getAutoCommit(java.sql.Connection conn)
           
static boolean getBoolean(java.sql.ResultSet set, int idx)
           
static java.lang.Double getDouble(java.sql.ResultSet set, int idx)
           
static com.wm.app.tn.util.ScrollableEnumeration getResults(java.sql.ResultSet set, java.lang.String[] keys)
          Create a scrolled enumeration of IDatas from a result set.
static java.sql.Timestamp getTimestamp(java.sql.ResultSet rs, int idx)
           
static java.lang.String getTimestampAsUTCString(java.sql.Timestamp ts)
           
static int getUTCDateAsNumber()
          Function for retrieving the current date as an integer.
static java.lang.String normalize(short form, java.lang.String s)
           
static void rollback(java.sql.Connection conn)
           
static void setAutoCommit(java.sql.Connection conn, boolean ac)
           
static void setBinaryEmpty(java.sql.PreparedStatement stmt, int idx)
           
static void setBinaryStream(java.sql.PreparedStatement stmt, int idx, byte[] data)
           
static void setBinaryStream(java.sql.PreparedStatement stmt, int idx, com.wm.data.IData data)
           
static void setBinaryStream(java.sql.PreparedStatement stmt, int idx, java.io.InputStream in, int len)
           
static void setBoolean(java.sql.PreparedStatement stmt, int idx, boolean value)
           
static void setBytes(java.sql.PreparedStatement stmt, int idx, byte[] data)
           
static void setBytes(java.sql.PreparedStatement stmt, int idx, com.wm.data.IData data)
           
static void setCharString(java.sql.PreparedStatement stmt, int idx, java.lang.String s)
           
static void setCharString(java.sql.PreparedStatement stmt, int idx, java.lang.String s, int max)
           
static void setCharString(java.sql.PreparedStatement stmt, int idx, java.lang.String s, int max, short form)
           
static void setCharString(java.sql.PreparedStatement stmt, int idx, java.lang.String s, short form)
           
static void setChoppedString(java.sql.PreparedStatement stmt, int idx, java.lang.String s, java.lang.String which)
           
static void setChoppedString(java.sql.PreparedStatement stmt, int idx, java.lang.String s, java.lang.String which, short form)
           
static void setDouble(java.sql.PreparedStatement stmt, int idx, java.lang.Double d)
           
static void setInteger(java.sql.PreparedStatement stmt, int idx, java.lang.Integer i)
           
static void setLongString(java.sql.PreparedStatement stmt, int idx, java.lang.String s)
           
static void setLongString(java.sql.PreparedStatement stmt, int idx, java.lang.String s, short form)
           
static void setNow(java.sql.PreparedStatement stmt, int idx)
           
static void setObject(java.sql.PreparedStatement stmt, int idx, java.lang.Object o)
           
static void setString(java.sql.PreparedStatement stmt, int idx, java.lang.String s)
           
static void setString(java.sql.PreparedStatement stmt, int idx, java.lang.String s, int max)
           
static void setString(java.sql.PreparedStatement stmt, int idx, java.lang.String s, int max, short form)
           
static void setString(java.sql.PreparedStatement stmt, int idx, java.lang.String s, short form)
           
static void setTimestamp(java.sql.PreparedStatement stmt, int idx, java.sql.Timestamp t)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORM_NONE

public static final short NORM_NONE
See Also:
Constant Field Values

NORM_FORM_C

public static final short NORM_FORM_C
See Also:
Constant Field Values

NORM_FORM_KC

public static final short NORM_FORM_KC
See Also:
Constant Field Values
Constructor Detail

SQLWrappers

public SQLWrappers()
Method Detail

normalize

public static java.lang.String normalize(short form,
                                         java.lang.String s)

setChoppedString

public static void setChoppedString(java.sql.PreparedStatement stmt,
                                    int idx,
                                    java.lang.String s,
                                    java.lang.String which)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

setChoppedString

public static void setChoppedString(java.sql.PreparedStatement stmt,
                                    int idx,
                                    java.lang.String s,
                                    java.lang.String which,
                                    short form)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

setString

public static final void setString(java.sql.PreparedStatement stmt,
                                   int idx,
                                   java.lang.String s)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

public static final void setObject(java.sql.PreparedStatement stmt,
                                   int idx,
                                   java.lang.Object o)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

setString

public static final void setString(java.sql.PreparedStatement stmt,
                                   int idx,
                                   java.lang.String s,
                                   short form)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

setString

public static final void setString(java.sql.PreparedStatement stmt,
                                   int idx,
                                   java.lang.String s,
                                   int max)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

setString

public static final void setString(java.sql.PreparedStatement stmt,
                                   int idx,
                                   java.lang.String s,
                                   int max,
                                   short form)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

setCharString

public static final void setCharString(java.sql.PreparedStatement stmt,
                                       int idx,
                                       java.lang.String s)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

setCharString

public static final void setCharString(java.sql.PreparedStatement stmt,
                                       int idx,
                                       java.lang.String s,
                                       short form)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

setCharString

public static final void setCharString(java.sql.PreparedStatement stmt,
                                       int idx,
                                       java.lang.String s,
                                       int max)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

setCharString

public static final void setCharString(java.sql.PreparedStatement stmt,
                                       int idx,
                                       java.lang.String s,
                                       int max,
                                       short form)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

setLongString

public static final void setLongString(java.sql.PreparedStatement stmt,
                                       int idx,
                                       java.lang.String s)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

setLongString

public static final void setLongString(java.sql.PreparedStatement stmt,
                                       int idx,
                                       java.lang.String s,
                                       short form)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

setDouble

public static final void setDouble(java.sql.PreparedStatement stmt,
                                   int idx,
                                   java.lang.Double d)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

setInteger

public static final void setInteger(java.sql.PreparedStatement stmt,
                                    int idx,
                                    java.lang.Integer i)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getDouble

public static final java.lang.Double getDouble(java.sql.ResultSet set,
                                               int idx)
                                        throws java.sql.SQLException
Throws:
java.sql.SQLException

setNow

public static final void setNow(java.sql.PreparedStatement stmt,
                                int idx)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

setTimestamp

public static final void setTimestamp(java.sql.PreparedStatement stmt,
                                      int idx,
                                      java.sql.Timestamp t)
                               throws java.sql.SQLException
Throws:
java.sql.SQLException

getTimestamp

public static final java.sql.Timestamp getTimestamp(java.sql.ResultSet rs,
                                                    int idx)
                                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getTimestampAsUTCString

public static final java.lang.String getTimestampAsUTCString(java.sql.Timestamp ts)

getUTCDateAsNumber

public static final int getUTCDateAsNumber()
Function for retrieving the current date as an integer. Time part of the date will not be considered for this function. The format for the date value returned will be 'YYYYMMDD'.

Returns:
the current date in YYYYMMDD format

setBoolean

public static final void setBoolean(java.sql.PreparedStatement stmt,
                                    int idx,
                                    boolean value)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getBoolean

public static final boolean getBoolean(java.sql.ResultSet set,
                                       int idx)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

setBytes

public static final void setBytes(java.sql.PreparedStatement stmt,
                                  int idx,
                                  com.wm.data.IData data)
                           throws java.sql.SQLException,
                                  java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

setBytes

public static final void setBytes(java.sql.PreparedStatement stmt,
                                  int idx,
                                  byte[] data)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

setBinaryStream

public static final void setBinaryStream(java.sql.PreparedStatement stmt,
                                         int idx,
                                         com.wm.data.IData data)
                                  throws java.sql.SQLException,
                                         java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

setBinaryStream

public static final void setBinaryStream(java.sql.PreparedStatement stmt,
                                         int idx,
                                         byte[] data)
                                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setBinaryStream

public static final void setBinaryStream(java.sql.PreparedStatement stmt,
                                         int idx,
                                         java.io.InputStream in,
                                         int len)
                                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setBinaryEmpty

public static final void setBinaryEmpty(java.sql.PreparedStatement stmt,
                                        int idx)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

commit

public static final void commit(java.sql.Connection conn)

rollback

public static final void rollback(java.sql.Connection conn)

setAutoCommit

public static final void setAutoCommit(java.sql.Connection conn,
                                       boolean ac)

getAutoCommit

public static final java.lang.Boolean getAutoCommit(java.sql.Connection conn)

close

public static final void close(java.sql.Connection conn)

close

public static final void close(java.sql.Statement stmt)

close

public static final void close(java.sql.ResultSet set)

getResults

public static com.wm.app.tn.util.ScrollableEnumeration getResults(java.sql.ResultSet set,
                                                                  java.lang.String[] keys)
                                                           throws java.sql.SQLException
Create a scrolled enumeration of IDatas from a result set.

Parameters:
set - the results in question (will NOT be closed when done)
keys - string names for columns
Returns:
an enumeration of IDatas
Throws:
java.sql.SQLException