jp.ac.naka.ec.db
クラス DatabaseConnector

java.lang.Object
  上位を拡張 jp.ac.naka.ec.db.DatabaseConnector

public class DatabaseConnector
extends java.lang.Object

データベースの管理クラス。

作成者:
Takashi Kasuya

フィールドの概要
static java.lang.String catalog
           
static java.lang.String data_table
           
static java.lang.String db_location
           
static java.lang.String driver_name
           
static java.lang.String entity_table
           
static java.lang.String location_table
           
static int MAX_COLUMN_REQUEST
           
static java.lang.String pass
           
static java.lang.String top_table
           
static java.lang.String type_table
           
static java.lang.String user
           
 
メソッドの概要
 boolean createNewTable()
          新しいテーブルの作成
 jp.ac.naka.ec.db.EventData[] getData(java.lang.String uri, int num)
          Retireve specified data of selected uri
static DatabaseConnector getInstance()
          Retrieve an Instance.
 boolean hasTables()
          テーブルが作られているか?
static void initialize()
          Initiazie JDBC parameter.
 boolean store(DataObject data)
          SQLクエリを自動的発行し、オートコミットしてデータを保存する。
 int store(EntityType type, SensorData data, Entity source)
           
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

driver_name

public static java.lang.String driver_name

db_location

public static java.lang.String db_location

catalog

public static java.lang.String catalog

user

public static java.lang.String user

pass

public static java.lang.String pass

top_table

public static java.lang.String top_table

type_table

public static java.lang.String type_table

data_table

public static java.lang.String data_table

entity_table

public static java.lang.String entity_table

location_table

public static java.lang.String location_table

MAX_COLUMN_REQUEST

public static int MAX_COLUMN_REQUEST
メソッドの詳細

getInstance

public static DatabaseConnector getInstance()
                                     throws java.sql.SQLException
Retrieve an Instance.

戻り値:
例外:
java.sql.SQLException

initialize

public static void initialize()
                       throws java.lang.ClassNotFoundException,
                              java.sql.SQLException
Initiazie JDBC parameter.

例外:
java.lang.ClassNotFoundException
java.sql.SQLException

hasTables

public boolean hasTables()
                  throws java.sql.SQLException
テーブルが作られているか?

戻り値:
例外:
java.sql.SQLException

createNewTable

public boolean createNewTable()
                       throws java.sql.SQLException
新しいテーブルの作成

戻り値:
テーブルが作成されたらtrue
例外:
java.sql.SQLException

store

public int store(EntityType type,
                 SensorData data,
                 Entity source)
          throws java.sql.SQLException
パラメータ:
type -
data -
source -
戻り値:
例外:
java.sql.SQLException

store

public boolean store(DataObject data)
              throws java.sql.SQLException
SQLクエリを自動的発行し、オートコミットしてデータを保存する。失敗するとfalseを返す。

パラメータ:
data -
戻り値:
例外:
java.sql.SQLException

getData

public jp.ac.naka.ec.db.EventData[] getData(java.lang.String uri,
                                            int num)
                                     throws java.sql.SQLException
Retireve specified data of selected uri

パラメータ:
uri -
num -
戻り値:
例外:
java.sql.SQLException