Results 1 to 8 of 8
- 04-22-2012, 04:25 PM #1
Updating Ms Access Database using jsp
I am updating my MS Access database using JSP.
I am getting this exception...
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
table name is "user_registration".
My code is--
ResultSet rs;
rs = st1.executeQuery("select * from user_registration where username='" + s1 + "' and password='" + s2 + "'");
while(rs.next())
{
PreparedStatement ps=null;
ps=con.prepareStatement("update user_registration set values(?,?,?,?,?,?,?,?,?,?,?,?,?) where username=?");
ps.setString(14,username);
ps.setString(1,firstname);
ps.setString(2,lastname);
ps.setString(3,username);
ps.setString(4,password);
ps.setString(5,confirm);
ps.setString(6,date);
ps.setString(7,month);
ps.setString(8,year);
ps.setString(9,gender);
ps.setString(10,mobile);
ps.setString(11,email);
ps.setString(12,image);
ps.setString(13,"u");
if(ps!=null)
{
ps.executeUpdate();
}
else
{
ps.close();
}
if(con==null)
{
con.close();
}
}
.gif)
Please Help..!!
- 04-22-2012, 04:26 PM #2
Re: Updating Ms Access Database using jsp
Why do they call it rush hour when nothing moves? - Robin Williams
- 04-23-2012, 11:13 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: Updating Ms Access Database using jsp
Please use [code] tags [/code] when posting code. See the link provided by Darryl.
What do the Access docs say about the structure of an UPDATE statement?
Are you sure your fields are all Strings (VARCHAR or whatever they're called in Access) in the database?Please do not ask for code as refusal often offends.
- 05-02-2012, 03:20 PM #4
Re: Updating Ms Access Database using jsp
I have checked, All fields are strings.
- 05-02-2012, 03:22 PM #5
Re: Updating Ms Access Database using jsp
thanks Darryl....I will mind this now..
- 05-02-2012, 05:10 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: Updating Ms Access Database using jsp
Run that update directly in Access, with the values you are having problems with.
Please do not ask for code as refusal often offends.
- 06-29-2012, 05:42 PM #7
Re: Updating Ms Access Database using jsp
now this exception is occured...
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
- 07-01-2012, 06:07 PM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
Problem updating access database from jsp
By Penhexy in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 03-17-2011, 08:50 AM -
How to convert access database to mysql database?
By vrk in forum Advanced JavaReplies: 2Last Post: 02-11-2009, 04:43 AM -
Updating database table from JTable
By yesjava in forum New To JavaReplies: 1Last Post: 08-16-2008, 10:16 PM -
Help needed with updating mysql database
By SilentCodingOne in forum New To JavaReplies: 1Last Post: 12-11-2007, 10:23 PM -
Help with access a database using Microsoft Access
By cachi in forum JDBCReplies: 1Last Post: 08-07-2007, 07:51 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks