com.bbn.openmap.layer.location.db
Class RawDataRecordSet

java.lang.Object
  extended by com.bbn.openmap.layer.location.db.RawDataRecordSet

public class RawDataRecordSet
extends java.lang.Object

This class is responsible for retrieving Raw Data from a table in a Database given a key. Users of this class should provide Database connection, Table name, Column name that has the key and column name that has the actual data.

If you are going to use this, there are a couple of properties to set:
prefix.rawDataTableName=table name
prefix.rawDataColumnName=data column name
prefix.rawDataKeyColumnName=data key name


Field Summary
protected  java.util.Hashtable byteCache
          A hashtable to keep track of the byte arrays, using the key.
protected  java.sql.Connection connection
          Connection object that will be used to retrieve data
protected  java.lang.String rawDataColumnName
          Column name in the above table that has Raw Data
static java.lang.String rawDataColumnNameProperty
           
protected  java.lang.String rawDataKeyColumnName
          Column name which has the key to lookup above data
static java.lang.String rawDataKeyColumnNameProperty
           
protected  java.lang.String tableName
          Table name from which data would be retrieved
static java.lang.String tableNameProperty
           
 
Constructor Summary
RawDataRecordSet()
           
RawDataRecordSet(java.sql.Connection inConnection)
           
RawDataRecordSet(java.sql.Connection inconnection, java.lang.String prefix, java.util.Properties properties)
           
 
Method Summary
 java.sql.Connection getConnection()
           
 byte[] getRawData(java.lang.String lookUpKey)
          Returns a byte[] array if successful, null otherwise
 java.lang.String getRawDataColumnName()
           
 java.lang.String getRawDataKeyColumnName()
           
 java.lang.String getTableName()
           
 void setConnection(java.sql.Connection inConnection)
           
 void setRawDataColumnName(java.lang.String inrawDataColumnName)
           
 void setRawDataKeyColumnName(java.lang.String inrawDataKeyColumnName)
           
 void setTableName(java.lang.String inTableName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

protected java.sql.Connection connection
Connection object that will be used to retrieve data


tableName

protected java.lang.String tableName
Table name from which data would be retrieved


rawDataColumnName

protected java.lang.String rawDataColumnName
Column name in the above table that has Raw Data


rawDataKeyColumnName

protected java.lang.String rawDataKeyColumnName
Column name which has the key to lookup above data


byteCache

protected java.util.Hashtable byteCache
A hashtable to keep track of the byte arrays, using the key. This will reduce the calls to the database.


tableNameProperty

public static final java.lang.String tableNameProperty
See Also:
Constant Field Values

rawDataColumnNameProperty

public static final java.lang.String rawDataColumnNameProperty
See Also:
Constant Field Values

rawDataKeyColumnNameProperty

public static final java.lang.String rawDataKeyColumnNameProperty
See Also:
Constant Field Values
Constructor Detail

RawDataRecordSet

public RawDataRecordSet()

RawDataRecordSet

public RawDataRecordSet(java.sql.Connection inConnection)

RawDataRecordSet

public RawDataRecordSet(java.sql.Connection inconnection,
                        java.lang.String prefix,
                        java.util.Properties properties)
Method Detail

getRawData

public byte[] getRawData(java.lang.String lookUpKey)
                  throws java.sql.SQLException
Returns a byte[] array if successful, null otherwise

Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()

setConnection

public void setConnection(java.sql.Connection inConnection)

getTableName

public java.lang.String getTableName()

setTableName

public void setTableName(java.lang.String inTableName)

getRawDataColumnName

public java.lang.String getRawDataColumnName()

setRawDataColumnName

public void setRawDataColumnName(java.lang.String inrawDataColumnName)

getRawDataKeyColumnName

public java.lang.String getRawDataKeyColumnName()

setRawDataKeyColumnName

public void setRawDataKeyColumnName(java.lang.String inrawDataKeyColumnName)


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details