/** * INTERNAL: Extract the direct values from the specified field value. Return them in a vector. * The field value better be an Array. */ public Vector buildDirectValuesFromFieldValue(Object fieldValue) throws DatabaseException { if (fieldValue == null) { return null; } return Helper.vectorFromArray((Object[]) fieldValue); }
/** * INTERNAL: Appends an Oracle specific Timestamp, if usesNativeSQL is true otherwise use the ODBC * format. Native Format: to_timestamp ('1997-11-06 10:35:45.656' , 'yyyy-mm-dd hh:mm:ss.ff') */ protected void appendTimestamp(java.sql.Timestamp timestamp, Writer writer) throws IOException { if (usesNativeSQL()) { writer.write("to_timestamp('"); writer.write(Helper.printTimestamp(timestamp)); writer.write("','yyyy-mm-dd HH24:MI:SS.FF')"); } else { super.appendTimestamp(timestamp, writer); } }
/** * INTERNAL: Build the appropriate field value for the specified set of direct values. The * database better be expecting an ARRAY. */ public Object buildFieldValueFromDirectValues( Vector directValues, String elementDataTypeName, AbstractSession session) throws DatabaseException { Object[] fields = Helper.arrayFromVector(directValues); try { ((DatabaseAccessor) session.getAccessor()).incrementCallCount(session); java.sql.Connection connection = ((DatabaseAccessor) session.getAccessor()).getConnection(); return session.getPlatform().createArray(elementDataTypeName, fields, session, connection); } catch (java.sql.SQLException ex) { throw DatabaseException.sqlException(ex, session, false); } finally { ((DatabaseAccessor) session.getAccessor()).decrementCallCount(); } }
/** INTERNAL: */ protected synchronized void initializeConnectionData(Connection conn) throws SQLException { if (isConnectionDataInitialized) { return; } driverVersion = conn.getMetaData().getDriverVersion(); // printCalendar for versions greater or equal 9 and less than 10.2.0.4 shouldPrintCalendar = Helper.compareVersions("9", driverVersion) <= 0 && Helper.compareVersions(driverVersion, "10.2.0.4") < 0; if (Helper.compareVersions(driverVersion, "11.1.0.7") < 0) { isTimestampInGmt = false; } else { if (conn instanceof OracleConnection) { String timestampTzInGmtPropStr = ((OracleConnection) conn) .getProperties() .getProperty("oracle.jdbc.timestampTzInGmt", "true"); isTimestampInGmt = timestampTzInGmtPropStr.equalsIgnoreCase("true"); } else { isTimestampInGmt = true; } } isConnectionDataInitialized = true; }