• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Identify not null columns

 
Kishan Kumar
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there is anyway we can identify columns with "not null" constraint in a given table.
Thanks for your time.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ResultSetMetaData.isNullable:
public int isNullable(int column) throws SQLException
Indicates the nullability of values in the designated column.
Parameters:
column - the first column is 1, the second is 2, ...
Returns:
the nullability status of the given column; one of columnNoNulls, columnNullable or columnNullableUnknown
Throws:
SQLException - if a database access error occurs
[ July 30, 2002: Message edited by: Jamie Robertson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic