Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use this method:</p> <blockquote> <p>java.sql.DatabaseMetaData.getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)</p> <p>Each column description has the following columns: Each column description has the following columns:</p> </blockquote> <pre><code> 1. TABLE_CAT String =&gt; table catalog (may be null) 2. TABLE_SCHEM String =&gt; table schema (may be null) 3. TABLE_NAME String =&gt; table name 4. COLUMN_NAME String =&gt; column name 5. DATA_TYPE int =&gt; SQL type from java.sql.Types 6. TYPE_NAME String =&gt; Data source dependent type name, for a UDT the type name is fully qualified 7. COLUMN_SIZE int =&gt; column size. 8. BUFFER_LENGTH is not used. 9. DECIMAL_DIGITS int =&gt; the number of fractional digits. Null is returned for data types where DECIMAL_DIGITS is not applicable. 10. NUM_PREC_RADIX int =&gt; Radix (typically either 10 or 2) 11. NULLABLE int =&gt; is NULL allowed. * columnNoNulls - might not allow NULL values * columnNullable - definitely allows NULL values * columnNullableUnknown - nullability unknown 12. REMARKS String =&gt; comment describing column (may be null) 13. COLUMN_DEF String =&gt; default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be null) 14. SQL_DATA_TYPE int =&gt; unused 15. SQL_DATETIME_SUB int =&gt; unused 16. CHAR_OCTET_LENGTH int =&gt; for char types the maximum number of bytes in the column 17. ORDINAL_POSITION int =&gt; index of column in table (starting at 1) 18. IS_NULLABLE String =&gt; ISO rules are used to determine the nullability for a column. * YES --- if the parameter can include NULLs * NO --- if the parameter cannot include NULLs * empty string --- if the nullability for the parameter is unknown 19. SCOPE_CATLOG String =&gt; catalog of table that is the scope of a reference attribute (null if DATA_TYPE isn't REF) 20. SCOPE_SCHEMA String =&gt; schema of table that is the scope of a reference attribute (null if the DATA_TYPE isn't REF) 21. SCOPE_TABLE String =&gt; table name that this the scope of a reference attribure (null if the DATA_TYPE isn't REF) 22. SOURCE_DATA_TYPE short =&gt; source type of a distinct type or user-generated Ref type, SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF) 23. IS_AUTOINCREMENT String =&gt; Indicates whether this column is auto incremented * YES --- if the column is auto incremented * NO --- if the column is not auto incremented * empty string --- if it cannot be determined whether the column is auto incremented parameter is unknown </code></pre> <p>A simple implementation:</p> <pre><code>ResultSet columns = dbmd.getColumns(null, null, tableName, null); final List&lt;String&gt; columnList = new ArrayList&lt;String&gt;(); while (columns.next()) { columnList.add(columns.getString(4)); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload