This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Column name too wide Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Column name too wide" Watch "Column name too wide" New topic

Column name too wide

Mel Calvin

Joined: Sep 11, 2007
Posts: 9
If I have a sql query that looks like this:

and result is returned as a collection of dynabeans. When I want to retrieve the data from the updated_date column I need to write like this:

with the "column name" truncated down to 32 chars, else it won't work. Now, this isn't an elegant solution. Anyone have better solution for this?

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Could you not alias the columns in your result set? i.e.:

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mel Calvin

Joined: Sep 11, 2007
Posts: 9
Aah.. I knew there was a SQL-side solution to this. My SQL skills are limited, thanks for the help!
I agree. Here's the link:
subject: Column name too wide
It's not a secret anymore!