I am trying to get the non-nullable columns of a table thro开发者_StackOverflowugh a java code.... Can anyone help me?
It is not completely clear what you are asking. Do you want to find out, from your Java program, which columns of a specific table are not nullable?
You can call java.sql.DatabaseMetaData.getColumns()
to get information about the columns of a table. One of the items that you'll get back is IS_NULLABLE
, which indicates if the column is nullable. See the API documentation of the getColumns
method for detailed information.
not a Java answer, but you can query for it!
select
table_name,
columns_name,
data_type,
nullable
from ALL_TAB_COLUMNS
supply the table_name and filter on nullable
精彩评论