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.
The moose likes JDBC and the fly likes Doubt in JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Doubt in JDBC" Watch "Doubt in JDBC" New topic
Author

Doubt in JDBC

ChakraPani Margani
Greenhorn

Joined: Aug 19, 2007
Posts: 17
Hai to all members,
First of all thanks to Mr.Krishna Moorthy for sending the clarification to me.

while I running the program I got a RUN TIME Error.

The line at which I face problem is


rs=st.executeQuery("select * from uin where NUM="+UIN);


Here UIN is a string value.

NUM in the database is varchar2 type.

The exception is:Invalid column name..

please clarify my doubt.

Regards,
ChakraPani.M
Alice Corman
Greenhorn

Joined: Jun 21, 2006
Posts: 19
Literal string values must be enclosed in single quotes. Otherwise, the database may assume the string is a column name. Try

Edit: added code tags


[ August 25, 2007: Message edited by: Alice Corman ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Doubt in JDBC