public static String formatType(Connection conn,int pgType,int typeMod) throws SQLException {
  PreparedStatement prep=conn.prepareStatement("select typname from pg_catalog.pg_type where oid = ? and typtypmod = ?");
  prep.setInt(1,pgType);
  prep.setInt(2,typeMod);
  ResultSet rs=prep.executeQuery();
  if (rs.next()) {
    return rs.getString(1);
  }
  return null;
}

public static String formatType ( Connection conn , int pgType , int typeMod ) throws SQLException { PreparedStatement prep = conn . prepareStatement ( "select typname from pg_catalog.pg_type where oid = ? and typtypmod = ?" ) ; prep . setInt ( 1 , pgType ) ; prep . setInt ( 2 , typeMod ) ; ResultSet rs = prep . executeQuery ( ) ; if ( rs . next ( ) ) { return rs . getString ( 1 ) ; } return null ; }
check if the current session has access to this table . this method is called by the database .
