code: public TableColumnInfo getTableColumnInfo(Connection connection, String schema, String table) throws SQLException
      {
          if (schema == null || schema.length() == 0)
          {
              schema = connection.getCatalog();
          }
          PreparedStatement stmt = connection.prepareStatement("SELECT name,colid,length,usertype,prec,scale,status FROM "+getFullyQualifiedDboTableName(schema, "syscolumns")+" WHERE id=OBJECT_ID(?)");
          ResultSet results = null;
  
          ArrayList<ColumnInfo> columns = new ArrayList<ColumnInfo>();
          try
          {
              String objectName = getFullyQualifiedTableName(schema , table);
              stmt.setString(1, objectName);
  
              results = stmt.executeQuery();
  
              while (results.next())
              {
                  String name = results.getString("name");
                  int ordinalPosition = results.getInt("colid");
                  int size = results.getInt("length");
                  int type = sybaseToJDBCTypes.get(results.getInt("usertype"));
                  int precision = results.getInt("prec");
                  int scale = results.getInt("scale");
  
                  // http://www.sybase.com/detail?id=205883#syscol - How to Read syscolumns.status
                  boolean nullable = (results.getInt("status") & 8) != 0;
  
                  columns.add(new ColumnInfo(name, type, size, precision, scale, ordinalPosition, nullable));
              }
          }
          finally
          {
              closeResultSet(results, "Ignoring error whilst closing ResultSet that was used to query the DatabaseInfo");
  
              closeStatement(stmt, "Ignoring error whilst closing PreparedStatement that was used to query the DatabaseInfo");
          }
          Collections.sort(columns);
          return columns.isEmpty() ? null : new TableColumnInfo(null, schema, table, columns.toArray(new ColumnInfo[columns.size()]));
      }
docs: <p>Overridden to create the table metadata by hand rather than using the JDBC
  <code>DatabaseMetadata.getColumns()</code> method. This is because the Sybase driver fails
  when the connection is an XA connection unless you allow transactional DDL in tempdb.</p>