edu.iastate.jtm.util
Class MySqlConnector

java.lang.Object
  extended by edu.iastate.jtm.util.MySqlConnector

public class MySqlConnector
extends java.lang.Object

Author:
Jing Ding fcmodeler.pathbinder MetNet

Constructor Summary
MySqlConnector()
           
MySqlConnector(java.lang.String h, java.lang.String db, java.lang.String u, java.lang.String p)
          Creates a new instance of DbManager
 
Method Summary
 void addBatch(java.lang.String sql)
           
 void close()
           
 void commit()
           
 java.sql.Statement createStatement()
           
 void execute(java.lang.String sql)
           
 void executeFile(java.io.File sql)
          Run a sql file.
 java.sql.ResultSet executeQuery(java.lang.String sql)
           
static java.lang.String getSearchText(java.lang.String term, boolean caseSensitive, boolean exact)
           
 java.sql.Statement getStatement()
           
static void main(java.lang.String[] args)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql)
           
 void setBatchSize(int size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySqlConnector

public MySqlConnector(java.lang.String h,
                      java.lang.String db,
                      java.lang.String u,
                      java.lang.String p)
               throws java.sql.SQLException,
                      java.lang.InstantiationException,
                      java.lang.IllegalAccessException,
                      java.lang.ClassNotFoundException
Creates a new instance of DbManager

Throws:
java.sql.SQLException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException

MySqlConnector

public MySqlConnector()
               throws java.sql.SQLException,
                      java.lang.InstantiationException,
                      java.lang.IllegalAccessException,
                      java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
Method Detail

setBatchSize

public void setBatchSize(int size)

close

public void close()
           throws java.sql.SQLException
Throws:
java.sql.SQLException

getStatement

public java.sql.Statement getStatement()

addBatch

public void addBatch(java.lang.String sql)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

executeQuery

public java.sql.ResultSet executeQuery(java.lang.String sql)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

execute

public void execute(java.lang.String sql)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

executeFile

public void executeFile(java.io.File sql)
                 throws java.io.IOException,
                        java.sql.SQLException
Run a sql file.

Parameters:
sql - SQL command file.
Throws:
java.io.IOException
java.sql.SQLException

commit

public void commit()
            throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException
Throws:
java.sql.SQLException

createStatement

public java.sql.Statement createStatement()
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getSearchText

public static java.lang.String getSearchText(java.lang.String term,
                                             boolean caseSensitive,
                                             boolean exact)

main

public static void main(java.lang.String[] args)