CFEngine API

org.recommender.util
Class Database

java.lang.Object
  |
  +--org.recommender.util.Database

public class Database
extends java.lang.Object

Describes functions to maniplate databases thru JDBC.

Since:
JDK 1.2
Version:
Version 1.0.0, 05-13-2001
Author:
(Sameer Kadam)

Constructor Summary
Database()
           
 
Method Summary
static void createTable(java.lang.String tableName, java.lang.String tableFormat, java.sql.Statement stmt)
          Create an SQL table
static java.sql.Connection getConnection()
          Load in database properties and create connection with database using the url, username, password specified in the properties.
static void insertIntoTable(java.lang.String tableName, java.lang.String values, java.sql.Statement stmt)
          Insert value to a table.
static void showTable(java.lang.String tableName, java.sql.Statement stmt)
          Print out the whole table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Database

public Database()
Method Detail

getConnection

public static java.sql.Connection getConnection()
                                         throws java.sql.SQLException
Load in database properties and create connection with database using the url, username, password specified in the properties.

Returns:
Connection
Throws:
java.sql.SQLException

createTable

public static void createTable(java.lang.String tableName,
                               java.lang.String tableFormat,
                               java.sql.Statement stmt)
                        throws java.sql.SQLException
Create an SQL table

Parameters:
tableName -
tableFormat -
stmt -
Throws:
java.sql.SQLException

insertIntoTable

public static void insertIntoTable(java.lang.String tableName,
                                   java.lang.String values,
                                   java.sql.Statement stmt)
                            throws java.sql.SQLException
Insert value to a table.

Parameters:
tableName -
values -
stmt -
Throws:
java.sql.SQLException

showTable

public static void showTable(java.lang.String tableName,
                             java.sql.Statement stmt)
                      throws java.sql.SQLException
Print out the whole table.

Parameters:
tableName -
stmt -
Throws:
java.sql.SQLException

CFEngine API

Copyright © 2003 - Oregon State University www.orst.edu