jetweb is hosted by Hepforge, IPPP Durham

cedar.jetweb.db
Class DBBlob2Array

java.lang.Object
  extended by cedar.jetweb.db.DBBlob2Array

public abstract class DBBlob2Array
extends java.lang.Object

Utility class to convert from sql blob types stored in the DB into Vectors Only Integer implemented at the moment, as that's all I need.

Author:
J. Monk

Constructor Summary
DBBlob2Array()
           
 
Method Summary
static byte[] byteMe(java.lang.Object obj)
          Returns a byte array from any object.
static byte[] byteMe(java.util.Vector<java.lang.Integer> intArray)
          Returns a byte array from a vector of integers
static java.lang.Object convert(java.sql.Blob blob, java.lang.Class cl)
          Convert a blob into an object of the given class.
static java.util.Vector<java.lang.Integer> getInteger(java.sql.Blob blob)
          Returns a vector of Integers from a blob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBBlob2Array

public DBBlob2Array()
Method Detail

getInteger

public static java.util.Vector<java.lang.Integer> getInteger(java.sql.Blob blob)
                                                      throws java.sql.SQLException
Returns a vector of Integers from a blob

Throws:
java.sql.SQLException


byteMe

public static byte[] byteMe(java.util.Vector<java.lang.Integer> intArray)
Returns a byte array from a vector of integers


byteMe

public static byte[] byteMe(java.lang.Object obj)
Returns a byte array from any object. Only implemented Vector at the moment


convert

public static java.lang.Object convert(java.sql.Blob blob,
                                       java.lang.Class cl)
                                throws java.sql.SQLException
Convert a blob into an object of the given class. only implemented Vector at present

Parameters:
blob - the blob to convert
cl - the Class to convert to
Throws:
java.sql.SQLException