Re: New To Java - Cant't get Database Insert to work

2001-09-23 Thread BlyonsJ2EE
Right now, I have tried Microsofts own example of the SQL statement which does not differ much from my original statement it is in the form INSERT INTO Employees (FirstName,LastName, Title) VALUES ('Harry', 'Washington', 'Trainee'); However, I do not have a SQL client at home to test

Re: New To Java - Cant't get Database Insert to work

2001-09-23 Thread BlyonsJ2EE
Hi Dim, Thanks for your help. The problem is resolved. The error was caused because I apparently used a reserved word as a colum name in the database. In the original Servlet I was using the statement: INSERT INTO LINKS (VALUE, NAVIGATION_TEXT) VALUES ('George', 'Washington');

Re: New To Java - Cant't get Database Insert to work

2001-09-22 Thread Dmitri Colebatch
Hi, A better way to do this would be to use prepared statements: PreparedStatement pstmt = con.prepareStatement( insert into LINKS (VALUE, NAVIGATION_TEXT) values(?,?)); pstmt.setString(1, url); pstmt.setString(2, favName); pstmt.executeUpdate(); I'm not sure what is wrong with your sql...

Re: New To Java - Cant't get Database Insert to work

2001-09-22 Thread BlyonsJ2EE
Hi dim, Still having no success. I think it might be that access has a problem with prepared statements. I'll keep trying to insert successfully and will test it at work with Oracle. I will let you know what happens. Thanks, Brian

Re: New To Java - Cant't get Database Insert to work

2001-09-22 Thread Dmitri Colebatch
are you able to try the statement directly... using some equivalent of sqlplus? On Sat, 22 Sep 2001 [EMAIL PROTECTED] wrote: Hi dim, Still having no success. I think it might be that access has a problem with prepared statements. I'll keep trying to insert successfully and will test