fedora.server.utilities
Class SQLUtility

java.lang.Object
  extended byfedora.server.utilities.SQLUtility

public abstract class SQLUtility
extends java.lang.Object

Title: SQLUtility.java

Description:

-----------------------------------------------------------------------------

License and Copyright: The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The entire file consists of original code. Copyright © 2002-2005 by The Rector and Visitors of the University of Virginia and Cornell University. All rights reserved.

-----------------------------------------------------------------------------

Version:
$Id: SQLUtility.java,v 1.16 2005/01/19 21:34:30 cwilper Exp $
Author:
cwilper@cs.cornell.edu

Constructor Summary
SQLUtility()
           
 
Method Summary
static java.lang.String aposEscape(java.lang.String in)
           
static java.lang.String backslashEscape(java.lang.String in)
           
static void createNonExistingTables(ConnectionPool cPool, java.io.InputStream dbSpec, Logging log)
           
static void createTables(TableCreatingConnection tcConn, java.util.List tSpecs, Logging log)
           
static java.lang.String getLongString(java.sql.ResultSet rs, int pos)
          Get a long string, which could be a TEXT or CLOB type.
static java.util.List getNonExistingTables(java.sql.Connection conn, java.util.List tSpecs)
           
static void replaceInto(java.sql.Connection conn, java.lang.String tableName, java.lang.String[] columns, java.lang.String[] values, java.lang.String uniqueColumn)
           
static void replaceInto(java.sql.Connection conn, java.lang.String tableName, java.lang.String[] columns, java.lang.String[] values, java.lang.String uniqueColumn, boolean[] isNumeric, Logging log)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLUtility

public SQLUtility()
Method Detail

replaceInto

public static void replaceInto(java.sql.Connection conn,
                               java.lang.String tableName,
                               java.lang.String[] columns,
                               java.lang.String[] values,
                               java.lang.String uniqueColumn)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

replaceInto

public static void replaceInto(java.sql.Connection conn,
                               java.lang.String tableName,
                               java.lang.String[] columns,
                               java.lang.String[] values,
                               java.lang.String uniqueColumn,
                               boolean[] isNumeric,
                               Logging log)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getLongString

public static java.lang.String getLongString(java.sql.ResultSet rs,
                                             int pos)
                                      throws java.sql.SQLException
Get a long string, which could be a TEXT or CLOB type. (CLOBs require special handling -- this method normalizes the reading of them)

Throws:
java.sql.SQLException

createNonExistingTables

public static void createNonExistingTables(ConnectionPool cPool,
                                           java.io.InputStream dbSpec,
                                           Logging log)
                                    throws java.io.IOException,
                                           InconsistentTableSpecException,
                                           java.sql.SQLException
Throws:
java.io.IOException
InconsistentTableSpecException
java.sql.SQLException

getNonExistingTables

public static java.util.List getNonExistingTables(java.sql.Connection conn,
                                                  java.util.List tSpecs)
                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

createTables

public static void createTables(TableCreatingConnection tcConn,
                                java.util.List tSpecs,
                                Logging log)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

backslashEscape

public static java.lang.String backslashEscape(java.lang.String in)

aposEscape

public static java.lang.String aposEscape(java.lang.String in)