This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi, Is there a way to write a PreparedStatement that will let you assign the data values to an alias? If the datacolumn in the database is called Name, can you map it to the alias "CustomerName", through the prepared statement? Is there any other way to do this? Thanks, -Deb
Hi Deb, Most of the databases that I have worked with allow you to define column aliases in the SQL query, for example:
Note: I think that this may be part of standard SQL (but I'm not sure). However, if you want to change the column name _after_ you have created your "PreparedStatement" object, I don't think this is possible. Hope this has helped you. Good Luck, Avi.