TC Java
2011 Version

gov.nih.nlm.nls.tc.Db
Class DbBase

java.lang.Object
  extended by gov.nih.nlm.nls.tc.Db.DbBase

public class DbBase
extends java.lang.Object

This class is the database base object. It provides basic operations in DB.

History:

Version:
V-2011
Author:
NLM Lexical Systems Group

Constructor Summary
DbBase()
           
 
Method Summary
static void CloseConnection(java.sql.Connection conn)
          Close a specified connection (session) with a database
static void ExecuteDdl(java.lang.String query, java.sql.Connection conn)
          Execute the DB data definiton language query.
static int ExecuteSql(java.lang.String query, java.sql.Connection conn)
          Execute the DB sql query.
static java.sql.Connection OpenConnection(Configuration config)
          Open a connection using URL specified in configuration bundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbBase

public DbBase()
Method Detail

OpenConnection

public static java.sql.Connection OpenConnection(Configuration config)
Open a connection using URL specified in configuration bundle

Parameters:
config - configuration bundle
Returns:
a connection (session) with the specific database

CloseConnection

public static void CloseConnection(java.sql.Connection conn)
Close a specified connection (session) with a database

Parameters:
conn - database connection

ExecuteDdl

public static void ExecuteDdl(java.lang.String query,
                              java.sql.Connection conn)
Execute the DB data definiton language query.

Parameters:
query - Db query
conn - Db connection

ExecuteSql

public static int ExecuteSql(java.lang.String query,
                             java.sql.Connection conn)
Execute the DB sql query.

Parameters:
query - Db query
conn - Db connection

TC Java
2011 Version

Submit a bug or feature

Copyright © 2011 National Library of Medicine