File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes regarding Update syntax of query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "regarding Update syntax of query" Watch "regarding Update syntax of query" New topic
Author

regarding Update syntax of query

smitaj joshi
Greenhorn

Joined: Dec 24, 2008
Posts: 3
String sql="update registration set phoneno=" + phone1 + ","+ "emailid=" + emailid1 + " where name="+name1;
System.out.println(sql);
stmt=con.prepareStatement(sql);
stmt.executeUpdate()
stmt.close();
con.close();
ouput of sql-> update registration set phoneno=9860878112,emailid=smita.joshi@gmail.com where name=smita


[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'smita.joshi@gmail.com'.
Dany Mendez
Greenhorn

Joined: Nov 04, 2008
Posts: 14
Hello smitaj joshi,

I dont't work with that DBMS, I use oracle, so this is a suggestion.

I can see that you do not limit the strings, could that be the problem?
Like so,
update registration set phoneno=9860878112,emailid='smita.joshi@gmail.com' where name='smita'

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regarding Update syntax of query
 
Similar Threads
user validation page
Access DB
Need help with a SQL statement
Can someone figure out whats wrong with this SQL
Update Database