skip to main content
About the Driver : Using the Driver : Using Client Information : Returning MetaData About Client Information Locations
  
Returning MetaData About Client Information Locations
You may want to return metadata about the register, variable, or column in which the database stores client information. For example, you may want to determine the maximum length allowed for a client information value before you store that information. If your application attempts to set a client information value that exceeds the maximum length allowed by the database, that value is truncated and the driver generates a warning. Determining the maximum length of the value beforehand can avoid this situation.
To return metadata about client information, call the DatabaseMetaData.getClientInfoProperties() method:
// Get Database Connection
Connection con = DriverManager.getConnection(
   "jdbc:datadirect:redshift://server1:5439;DatabaseName=jdbc", "test", "secret");
DatabaseMetaData metaData = con.getMetaData();
ResultSet rs = metaData.getClientInfoProperties();
...
The driver returns a result set that provides the following information for each client information property supported by the database:
*Property name
*Maximum length of the property value
*Default property value
*Property description