org.eclipse.datatools.sqltools.result.internal.utils
Class SQLUtil

java.lang.Object
  extended by org.eclipse.datatools.sqltools.result.internal.utils.SQLUtil

public class SQLUtil
extends java.lang.Object

SQL related utilities

Author:
Dafan Yang

Constructor Summary
SQLUtil()
           
 
Method Summary
static java.lang.String convertToString(int datatype)
          Converts the data type id to data type string
static java.lang.Object getObjectByTypeCoercion(java.sql.ResultSet resultSet, int index, int dataType)
           
static java.lang.Object getResultFromStream(java.io.ObjectInputStream ois)
          Returns Serializable object file
static boolean isNumericType(int datatype)
          Check if the given SQL type is numeric data type
static void saveResultToStream(java.io.ObjectOutputStream oos, java.lang.Object result)
          Saves result set to output stream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLUtil

public SQLUtil()
Method Detail

saveResultToStream

public static void saveResultToStream(java.io.ObjectOutputStream oos,
                                      java.lang.Object result)
                               throws java.io.IOException
Saves result set to output stream

Parameters:
oos - stream to write
result - result object
Throws:
java.io.IOException - - if an IO access error occurs

getResultFromStream

public static java.lang.Object getResultFromStream(java.io.ObjectInputStream ois)
Returns Serializable object file

Parameters:
ois - file to store object
Returns:
Serializable object

isNumericType

public static boolean isNumericType(int datatype)
Check if the given SQL type is numeric data type

Parameters:
datatype -
Returns:

convertToString

public static java.lang.String convertToString(int datatype)
Converts the data type id to data type string

Parameters:
datatype -
Returns:

getObjectByTypeCoercion

public static java.lang.Object getObjectByTypeCoercion(java.sql.ResultSet resultSet,
                                                       int index,
                                                       int dataType)
                                                throws java.sql.SQLException
Throws:
java.sql.SQLException