예제 #1
0
 /**
  * Returns the NLS_NChar_Characterset of the oracle database. Used for NCHAR, NVARCHAR2 and NCLOB.
  *
  * @param stmtExecuter <code>StatementExecuter</code> instance to perform the action</code>.
  * @return String declaring the used characterset
  * @exception SQLException Description of the Exception
  */
 private String getNLS_NChar_Characterset(StatementExecuter stmtExecuter) throws SQLException {
   // see
   // http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a76966/ch2.htm#97247
   try {
     return stmtExecuter.getSingleRowColAsString(
         "select VALUE from V$NLS_PARAMETERS where PARAMETER='NLS_NCHAR_CHARACTERSET'");
   } catch (SQLException e) {
     throw e;
   } catch (Exception e) {
     throw new DatabaseException(e);
   }
 }
예제 #2
0
 /**
  * @param domain Description of the Parameter
  * @param sequenceParameters Description of the Parameter
  * @param stmtExecuter Description of the Parameter
  * @exception SQLException Description of the Exception
  * @see #createSequence(AbstractDomain,String,StatementExecuter) *
  */
 public void createSequence(
     AbstractDomain domain, String sequenceParameters, StatementExecuter stmtExecuter)
     throws SQLException {
   try {
     stmtExecuter.executeUpdate("DROP SEQUENCE " + domain.getSequenceName());
   } catch (SQLException e) {
     // Ignore this exception since sequence may not be there.
   } catch (Exception e) {
     throw new DatabaseException(e);
   }
   try {
     if (sequenceParameters == null) {
       sequenceParameters = "";
     }
     stmtExecuter.executeUpdate(
         "CREATE SEQUENCE " + domain.getSequenceName() + " " + sequenceParameters);
   } catch (SQLException e) {
     throw e;
   } catch (Exception e) {
     throw new DatabaseException(e);
   }
 }