Java Code Examples for java.sql.JDBCType#getVendorTypeNumber()

The following examples show how to use java.sql.JDBCType#getVendorTypeNumber() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TableContextUtil.java    From datacollector with Apache License 2.0 6 votes vote down vote up
/**
 * Our own implementation of JDBCType.valueOf() that won't throw an exception in case of unknown type.
 *
 * @param jdbcType
 * @return
 */
public static String nameForType(DatabaseVendor vendor, int jdbcType) {
  for( JDBCType sqlType : JDBCType.class.getEnumConstants()) {
    if(jdbcType == sqlType.getVendorTypeNumber())
      return sqlType.name();
  }

  switch (vendor) {
    case ORACLE:
      switch (jdbcType) {
        case TYPE_ORACLE_TIMESTAMP_WITH_TIME_ZONE: return "TIMESTAMP WITH TIME ZONE";
        case TYPE_ORACLE_TIMESTAMP_WITH_LOCAL_TIME_ZONE: return "TIMESTAMP WITH LOCAL TIME ZONE";
      }
      break;
    case SQL_SERVER:
      switch (jdbcType) {
        case TYPE_SQL_SERVER_DATETIMEOFFSET: return "SQLSERVER DATETIMEOFFSET";
      }
      break;
  }

  return "Unknown";
}
 
Example 2
Source File: BaseTest.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "jdbcTypes")
protected Object[][] jdbcTypes() {
    Object[][] o = new Object[JDBCType.values().length][1];
    int pos = 0;
    for (JDBCType c : JDBCType.values()) {
        o[pos++][0] = c.getVendorTypeNumber();
    }
    return o;
}
 
Example 3
Source File: BaseTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "jdbcTypes")
protected Object[][] jdbcTypes() {
    Object[][] o = new Object[JDBCType.values().length][1];
    int pos = 0;
    for (JDBCType c : JDBCType.values()) {
        o[pos++][0] = c.getVendorTypeNumber();
    }
    return o;
}
 
Example 4
Source File: BaseTest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "jdbcTypes")
protected Object[][] jdbcTypes() {
    Object[][] o = new Object[JDBCType.values().length][1];
    int pos = 0;
    for (JDBCType c : JDBCType.values()) {
        o[pos++][0] = c.getVendorTypeNumber();
    }
    return o;
}
 
Example 5
Source File: BaseTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "jdbcTypes")
protected Object[][] jdbcTypes() {
    Object[][] o = new Object[JDBCType.values().length][1];
    int pos = 0;
    for (JDBCType c : JDBCType.values()) {
        o[pos++][0] = c.getVendorTypeNumber();
    }
    return o;
}
 
Example 6
Source File: BaseTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "jdbcTypes")
protected Object[][] jdbcTypes() {
    Object[][] o = new Object[JDBCType.values().length][1];
    int pos = 0;
    for (JDBCType c : JDBCType.values()) {
        o[pos++][0] = c.getVendorTypeNumber();
    }
    return o;
}
 
Example 7
Source File: BaseTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "jdbcTypes")
protected Object[][] jdbcTypes() {
    Object[][] o = new Object[JDBCType.values().length][1];
    int pos = 0;
    for (JDBCType c : JDBCType.values()) {
        o[pos++][0] = c.getVendorTypeNumber();
    }
    return o;
}
 
Example 8
Source File: BaseTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "jdbcTypes")
protected Object[][] jdbcTypes() {
    Object[][] o = new Object[JDBCType.values().length][1];
    int pos = 0;
    for (JDBCType c : JDBCType.values()) {
        o[pos++][0] = c.getVendorTypeNumber();
    }
    return o;
}
 
Example 9
Source File: BaseTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "jdbcTypes")
protected Object[][] jdbcTypes() {
    Object[][] o = new Object[JDBCType.values().length][1];
    int pos = 0;
    for (JDBCType c : JDBCType.values()) {
        o[pos++][0] = c.getVendorTypeNumber();
    }
    return o;
}
 
Example 10
Source File: BaseTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "jdbcTypes")
protected Object[][] jdbcTypes() {
    Object[][] o = new Object[JDBCType.values().length][1];
    int pos = 0;
    for (JDBCType c : JDBCType.values()) {
        o[pos++][0] = c.getVendorTypeNumber();
    }
    return o;
}