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 sql exception 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 "sql exception " Watch "sql exception " New topic
Author

sql exception

Aarthi moorthy
Greenhorn

Joined: Feb 24, 2003
Posts: 7
hi all,
I am updating a table with a set of values.
My code is

st.executeUpdate("update bulletinboard set (userid='"+s1+"',dateofposting='"+s2+"',messagetitle='"+s3+"',message='"+s4+"', administratorid='"+s5+"',typeofmessage='"+s6+"',expirydate='"+s7+"') where messageid=2");
I get an error as

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'messageid='.
Plz give me ur solutions..
Thanks in advance.
regards,
Aarthi.
Kirtikumar Puthran
Ranch Hand

Joined: Mar 04, 2003
Posts: 37
Hi Aarthi,
Try this :
st.executeUpdate("update bulletinboard set (userid='"+s1+"',dateofposting='"+s2+"',messagetitle='"+s3+"',message='"+s4+"', administratorid='"+s5+"',typeofmessage='"+s6+"',expirydate='"+s7+"') where messageid='2'");
I have changed the where clause.
Hope this helps.
Rgds,
Kirtikumar Puthran


Regards,<br />Kirti
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sql exception
 
It's not a secret anymore!