@Override public void initializeConnectionData(Connection connection) throws SQLException { if (this.isConnectionDataInitialized) { return; } DatabaseMetaData dmd = connection.getMetaData(); String databaseVersion = dmd.getDatabaseProductVersion(); this.isFractionalTimeSupported = Helper.compareVersions(databaseVersion, "5.6.4") >= 0; // Driver 5.1 supports NVARCHAR this.driverSupportsNationalCharacterVarying = Helper.compareVersions(dmd.getDriverVersion(), "5.1.0") >= 0; this.isConnectionDataInitialized = true; }
@Override public void initializeConnectionData(Connection connection) throws SQLException { if (this.isConnectionDataInitialized) { return; } DatabaseMetaData dmd = connection.getMetaData(); String databaseVersion = dmd.getDatabaseProductVersion(); this.isFractionalTimeSupported = Helper.compareVersions(databaseVersion, "5.6.4") >= 0; // Driver 5.1 supports NVARCHAR this.driverSupportsNationalCharacterVarying = Helper.compareVersions(dmd.getDriverVersion(), "5.1.0") >= 0; this.isConnectionDataInitialized = true; }
@Override public void initializeConnectionData(Connection connection) throws SQLException { DatabaseMetaData dmd = connection.getMetaData(); this.driverSupportsNationalCharacterVarying = Helper.compareVersions(dmd.getDriverVersion(), "7.0.0") >= 0; }
@Override public void initializeConnectionData(Connection connection) throws SQLException { DatabaseMetaData dmd = connection.getMetaData(); // Tested with 11.1.0.6 this.driverSupportsNationalCharacterVarying = Helper.compareVersions(dmd.getDriverVersion(), "11.1") >= 0; }
@Override public void initializeConnectionData(Connection connection) throws SQLException { DatabaseMetaData dmd = connection.getMetaData(); this.driverSupportsNationalCharacterVarying = Helper.compareVersions(dmd.getDriverVersion(), "7.0.0") >= 0; }
@Override public void initializeConnectionData(Connection connection) throws SQLException { DatabaseMetaData dmd = connection.getMetaData(); // Tested with 11.1.0.6 this.driverSupportsNationalCharacterVarying = Helper.compareVersions(dmd.getDriverVersion(), "11.1") >= 0; }
@Override public void initializeConnectionData(Connection connection) throws SQLException { if (isConnectionDataInitialized) { return; } DatabaseMetaData dmd = connection.getMetaData(); int databaseVersion = dmd.getDatabaseMajorVersion(); supportsSequenceObjects = databaseVersion >= 11; isConnectionDataInitialized = true; this.driverSupportsNationalCharacterVarying = Helper.compareVersions(dmd.getDriverVersion(), "4.0.0") >= 0; }
@Override public void initializeConnectionData(Connection connection) throws SQLException { if (isConnectionDataInitialized) { return; } DatabaseMetaData dmd = connection.getMetaData(); int databaseVersion = dmd.getDatabaseMajorVersion(); isVersion11OrHigher = databaseVersion >= 11; isConnectionDataInitialized = true; this.driverSupportsNationalCharacterVarying = Helper.compareVersions(dmd.getDriverVersion(), "4.0.0") >= 0; }
/** * INTERNAL: */ @Override public void initializeConnectionData(Connection connection) throws SQLException { if (isConnectionDataInitialized) { return; } String databaseVersion = connection.getMetaData().getDatabaseProductVersion(); if (Helper.compareVersions(databaseVersion, "10.6.1") >= 0) { isSequenceSupported = true; isOffsetFetchParameterSupported = true; } isConnectionDataInitialized = true; } }
/** * INTERNAL: */ @Override public void initializeConnectionData(Connection connection) throws SQLException { if (isConnectionDataInitialized) { return; } String databaseVersion = connection.getMetaData().getDatabaseProductVersion(); if (Helper.compareVersions(databaseVersion, "10.6.1") >= 0) { isSequenceSupported = true; isOffsetFetchParameterSupported = true; } isConnectionDataInitialized = true; } }
/** * INTERNAL: */ @Override public void initializeConnectionData(Connection connection) throws SQLException { if (this.isConnectionDataInitialized || (connection == null) || (connection.getMetaData() == null)) { return; } this.driverVersion = connection.getMetaData().getDriverVersion(); // printCalendar for versions greater or equal 9 and less than 10.2.0.4 this.shouldPrintCalendar = Helper.compareVersions("9", this.driverVersion) <= 0 && Helper.compareVersions(this.driverVersion, "10.2.0.4") < 0; if( Helper.compareVersions(this.driverVersion, "11.1.0.7") >= 0) { if(connection instanceof OracleConnection) { String timestampTzInGmtPropStr = ((OracleConnection)connection).getProperties().getProperty("oracle.jdbc.timestampTzInGmt", "true"); this.isTimestampInGmt = timestampTzInGmtPropStr.equalsIgnoreCase("true"); } else { this.isTimestampInGmt = true; } if (Helper.compareVersions(this.driverVersion, "11.2.0.2") >= 0) { this.isLtzTimestampInGmt = true; } } this.isConnectionDataInitialized = true; }
/** * INTERNAL: */ @Override public void initializeConnectionData(Connection connection) throws SQLException { if (this.isConnectionDataInitialized || (connection == null) || (connection.getMetaData() == null)) { return; } this.driverVersion = connection.getMetaData().getDriverVersion(); // printCalendar for versions greater or equal 9 and less than 10.2.0.4 this.shouldPrintCalendar = Helper.compareVersions("9", this.driverVersion) <= 0 && Helper.compareVersions(this.driverVersion, "10.2.0.4") < 0; if (Helper.compareVersions(this.driverVersion, "11.1.0.7") >= 0) { if( connection instanceof OracleConnection ) { final OracleConnection oraConn = (OracleConnection)connection; String timestampTzInGmtPropStr = oraConn.getProperties().getProperty("oracle.jdbc.timestampTzInGmt", "true"); this.connectionUserName = oraConn.getUserName(); this.isTimestampInGmt = timestampTzInGmtPropStr.equalsIgnoreCase("true"); } else { this.connectionUserName = connection.getMetaData().getUserName(); this.isTimestampInGmt = true; } if (Helper.compareVersions(this.driverVersion, "11.2.0.2") >= 0) { this.isLtzTimestampInGmt = true; } } this.isConnectionDataInitialized = true; }
/** * INTERNAL: * Compares two version in num.num.num.num.num*** format. * -1, 0, 1 means the version1 is less than, equal, greater than version2. * Example: compareVersions("11.1.0.6.0-Production", "11.1.0.7") == -1 */ public static int compareVersions(String version1, String version2) { return compareVersions(version(version1), version(version2)); }
/** * INTERNAL: * Compares two version in num.num.num.num.num*** format. * -1, 0, 1 means the version1 is less than, equal, greater than version2. * Example: compareVersions("11.1.0.6.0-Production", "11.1.0.7") == -1 * Example: compareVersions("WebLogic Server 10.3.4", "10.3.3.0") == 1 */ public static int compareVersions(String version1, String version2) { return compareVersions(version(version1), version(version2)); }
/** * INTERNAL: * Compares two version in num.num.num.num.num*** format. * -1, 0, 1 means the version1 is less than, equal, greater than version2. * Example: compareVersions("11.1.0.6.0-Production", "11.1.0.7") == -1 * Example: compareVersions("WebLogic Server 10.3.4", "10.3.3.0") == 1 */ public static int compareVersions(String version1, String version2) { return compareVersions(version(version1), version(version2)); }
/** * INTERNAL: Set the WLS version number through reflection. */ public void initializeServerNameAndVersion() { try { Class clazz = PrivilegedAccessHelper.getClassForName("weblogic.version"); Method method = PrivilegedAccessHelper.getMethod(clazz, "getReleaseBuildVersion", null, false); this.serverNameAndVersion = (String) PrivilegedAccessHelper.invokeMethod(method, null, null); this.shouldClearStatementCache = Helper.compareVersions(this.serverNameAndVersion, "10.3.4") < 0; } catch (Exception exception) { getDatabaseSession().getSessionLog().logThrowable(SessionLog.WARNING, SessionLog.SERVER, exception); } }
/** * INTERNAL: Set the WLS version number through reflection. */ public void initializeServerNameAndVersion() { try { Class clazz = PrivilegedAccessHelper.getClassForName("weblogic.version"); Method method = PrivilegedAccessHelper.getMethod(clazz, "getReleaseBuildVersion", null, false); this.serverNameAndVersion = (String) PrivilegedAccessHelper.invokeMethod(method, null, null); this.shouldClearStatementCache = Helper.compareVersions(this.serverNameAndVersion, "10.3.4") < 0; } catch (Exception exception) { getDatabaseSession().getSessionLog().logThrowable(SessionLog.WARNING, SessionLog.SERVER, exception); } }