Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6831273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:43:06+00:00 2026-05-26T22:43:06+00:00

As we all know, if we execute a sql for query, we can use

  • 0

As we all know, if we execute a sql for query, we can use rs.getMetaData() to get the result metadata. We use it to get the resultset column.

But if I use a callable, I want to get the column for the OUT Mode column name. How can i get it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:43:06+00:00Added an answer on May 26, 2026 at 10:43 pm

    You can use this method:

    java.sql.DatabaseMetaData.getColumns(String catalog, String
    schemaPattern, String tableNamePattern, String columnNamePattern)

    Each column description has the following columns:
    Each column description has the following columns:

       1. TABLE_CAT String => table catalog (may be null)
       2. TABLE_SCHEM String => table schema (may be null)
       3. TABLE_NAME String => table name
       4. COLUMN_NAME String => column name
       5. DATA_TYPE int => SQL type from java.sql.Types
       6. TYPE_NAME String => Data source dependent type name, for a UDT the type name is fully qualified
       7. COLUMN_SIZE int => column size.
       8. BUFFER_LENGTH is not used.
       9. DECIMAL_DIGITS int => the number of fractional digits. Null is returned for data types where DECIMAL_DIGITS is not applicable.
      10. NUM_PREC_RADIX int => Radix (typically either 10 or 2)
      11. NULLABLE int => is NULL allowed.
              * columnNoNulls - might not allow NULL values
              * columnNullable - definitely allows NULL values
              * columnNullableUnknown - nullability unknown 
      12. REMARKS String => comment describing column (may be null)
      13. COLUMN_DEF String => 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 => unused
      15. SQL_DATETIME_SUB int => unused
      16. CHAR_OCTET_LENGTH int => for char types the maximum number of bytes in the column
      17. ORDINAL_POSITION int => index of column in table (starting at 1)
      18. IS_NULLABLE String => 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 => catalog of table that is the scope of a reference attribute (null if DATA_TYPE isn't REF)
      20. SCOPE_SCHEMA String => schema of table that is the scope of a reference attribute (null if the DATA_TYPE isn't REF)
      21. SCOPE_TABLE String => table name that this the scope of a reference attribure (null if the DATA_TYPE isn't REF)
      22. SOURCE_DATA_TYPE short => 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 => 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 
    

    A simple implementation:

    ResultSet columns = dbmd.getColumns(null, null, tableName, null);
    final List<String> columnList = new ArrayList<String>();
    while (columns.next())
    {
         columnList.add(columns.getString(4));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to execute an SQL query and get its result in elisp: (let
we all know that the cell in uitableview can be resued, but i am
We all know how to use <ctrl>-R to reverse search through history, but did
We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired... I
We all know what virtual functions are in C++, but how are they implemented
We all know you can't do the following because of ConcurrentModificationException : for (Object
We all know the good old disable the submit button trick but what are
If I execute this from SQL Server, I get the output parameter with no
Can I safely prevent SQL Injection using PostgreSQL's Dollar-Quoted String Constants? I know the
I am making an SQL query in which I want to get some results

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.