Well, essentially, getPrecision() returns the number of digits allowed in a number type; getPrecision() returns the number of digits beyond the decimal point. These aren't applicable to a string type.

- David Gallardo

At 10:00 AM 11/7/2002 +0100, you wrote:
Hi All,

I've a problem with JDBC and ResultSetMetaData interface.
I'would know the length of a char or varchar column.

Here's my code :

ResultSet res = stmt.executeQuery("select * from x");
ResultSetMetaData rmtd = res.getMetaData();
for ( int i = 1 ; i <= rmtd.getColumnCount();i++)
{
     System.out.println("col "+i+ " : type  = " + rmtd.getColumnTypeName(i)
+ ", length  = "  + rmtd.getScale() );

}

____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to