sk.stuba.fiit.foo07.genex.common
Class DerbyDBTools

java.lang.Object
  extended by sk.stuba.fiit.foo07.genex.common.DerbyDBTools

public class DerbyDBTools
extends java.lang.Object

Author:
Martin

Constructor Summary
DerbyDBTools()
           
 
Method Summary
static void cleanDatabase(java.sql.Connection con)
          Cleans not-bound Keyword and Pictures from database
static boolean databaseInitialized(java.sql.Connection con)
           
static void loadData(java.sql.Connection con, java.lang.String xmlPath)
          Loads questions/answers from xml file into database
static int runScript(java.sql.Connection con, java.lang.String resourceFilePath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyDBTools

public DerbyDBTools()
Method Detail

runScript

public static int runScript(java.sql.Connection con,
                            java.lang.String resourceFilePath)
                     throws java.io.UnsupportedEncodingException,
                            java.lang.NullPointerException
Throws:
java.io.UnsupportedEncodingException
java.lang.NullPointerException

cleanDatabase

public static void cleanDatabase(java.sql.Connection con)
Cleans not-bound Keyword and Pictures from database


databaseInitialized

public static boolean databaseInitialized(java.sql.Connection con)

loadData

public static void loadData(java.sql.Connection con,
                            java.lang.String xmlPath)
                     throws java.sql.SQLException,
                            java.io.UnsupportedEncodingException
Loads questions/answers from xml file into database

Parameters:
con - - database connection
xmlPath - - path to xml resource
Throws:
java.sql.SQLException
java.io.UnsupportedEncodingException


Copyright © 2008 Faculty of Informatics and Information Technologies, STU Bratislava. All Rights Reserved.