Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes JDBC and Relational Databases and the fly likes Setting the column witdth Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Setting the column witdth " Watch "Setting the column witdth " New topic

Setting the column witdth

amarshi mohanty
Ranch Hand

Joined: Jul 01, 2008
Posts: 110
Hi All,
In the resultsetmetadata object , we have getColumnDisplaySize(),but there is no method to set.
setColumnDispalySize() method is present in RowSetMetadata().
In my case i have to populate the CachedRowset with Resultset.The width of a paticular column is varchar(65) in postgresql,but in the java side this is coming as -5.
So i have to re-set the width size before populating to CachedRowset,otherwise i am getting

java.sql.SQLException: Invalid column display size. Cannot be less than zero

Please suggest me.

SCJP (97%), SCWCD (95%))
Have you tried LearnNowOnline?
subject: Setting the column witdth