/**
   * Returns the fully-qualified name of the Java class whose instances are manufactured if the
   * method <code>ResultSet.getObject</code> is called to retrieve a value from the column. <code>
   * ResultSet.getObject</code> may return a subclass of the class returned by this method.
   *
   * @param column the first column is 1, the second is 2, ...
   * @return the fully-qualified name of the class in the Java programming language that would be
   *     used by the method <code>ResultSet.getObject</code> to retrieve the value in the specified
   *     column. This is the class name used for custom mapping.
   * @exception SQLException if a database access error occurs
   */
  public String getColumnClassName(int column) throws SQLException {
    Field field = getField(column);
    String result = connection.getTypeInfo().getJavaClass(field.getOID());

    if (result != null) return result;

    int sqlType = getSQLType(column);
    switch (sqlType) {
      case Types.ARRAY:
        return ("java.sql.Array");
      default:
        String type = getPGType(column);
        if ("unknown".equals(type)) {
          return ("java.lang.String");
        }
        return ("java.lang.Object");
    }
  }
Esempio n. 2
0
 /** {@inheritDoc} PostgreSQL doesn't have unsigned numbers */
 public boolean isSigned(int param) throws SQLException {
   checkParamIndex(param);
   return _connection.getTypeInfo().isSigned(_oids[param - 1]);
 }
Esempio n. 3
0
 public String getParameterTypeName(int param) throws SQLException {
   checkParamIndex(param);
   return _connection.getTypeInfo().getPGType(_oids[param - 1]);
 }
 /*
  * Does a column's case matter? ASSUMPTION: Any field that is
  * not obviously case insensitive is assumed to be case sensitive
  *
  * @param column the first column is 1, the second is 2...
  * @return true if so
  * @exception SQLException if a database access error occurs
  */
 public boolean isCaseSensitive(int column) throws SQLException {
   Field field = getField(column);
   return connection.getTypeInfo().isCaseSensitive(field.getOID());
 }
 protected int getSQLType(int columnIndex) throws SQLException {
   return connection.getTypeInfo().getSQLType(getField(columnIndex).getOID());
 }
 /*
  * What is a column's number of digits to the right of the
  * decimal point?
  *
  * @param column the first column is 1, the second is 2...
  * @return the scale
  * @exception SQLException if a database access error occurs
  */
 public int getScale(int column) throws SQLException {
   Field field = getField(column);
   return connection.getTypeInfo().getScale(field.getOID(), field.getMod());
 }