Forums Register Login

Problem connecting to my database.

+Pie Number of slices to send: Send
Hi, I have been working away for a while now on getting familiar with Java EE and I am trying to connect to a database. I believe I have been successful but I now have what seems to be a syntax problem with SQL. My error being produced by my testpage is

" javax.servlet.ServletException:
USE affablebean;
SELECT (*) FROM 'product';
: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT (*) FROM 'product'' at line 3"

As you can see I am working through the affablebean tutorial. I believe I have a connection to the database but I am getting SQL syntax errors now. Can someone please point me in the right direction for the solution to my problem.

Thanks,

Greg Funston
+Pie Number of slices to send: Send
Thanks, I found the solution to my problem. I had a statement which stated which database to use "USE affablebean" it was in the same place as the next statement
"SELECT * FROM tablename". I placed the first statement in a separate tag <sql:update> and the page now works correctly.



Cheers,

Greg Funston
Does this tiny ad smell okay to you?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1368 times.
Similar Threads
encrypted username breaks sql
datepart error
Error at the time of importing sql_dump(MYSQL5.0 )
SQL syntaxt error in CMP in JBoss 4.0
Create Stored Procedure
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:13:04.