•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 422,414 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,060 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 13195 | Replies: 13
![]() |
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation:
Rep Power: 18
Solved Threads: 197
> Javascript is amazing, I didn't think you could touch mysql with it!
You can't, at least not with browser embedded Javascript. It's a different ball game altogether if you are using Server Side Javascript.
You can't, at least not with browser embedded Javascript. It's a different ball game altogether if you are using Server Side Javascript.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
•
•
•
•
The code you have written is correct... but java is a case sensitive language so might be there is some problem with the case..
check it carefully
To tell you the truth, the code is not correct. This line
int UQ=statement.executeUpdate("insert into questions (qid, question, answer, subject) values ('," + questionin + "," + answerin + "," + subjectin + ")"); All this would not be a problem if the OP would two things that she should always do, and should have done from the beginning (but she probably learned from tutorials on roseindia, they love pushing this dope), which are:
1) Use a PreparedStatement. Do not cobble together a Statement like this. It is error prone in the coding, error prone in the execution (what happens if one of the variables contains a quote (') itself), and wide open to SQL injection attacks.
2) Don't use scriplets. They only still exist for backwards compatability and it is strongly reccommended not to use them anymore.
Last edited by masijade : May 28th, 2008 at 8:31 am.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- mysql UPDATE not working! Why? (PHP)
- connecting jsp with mysql database (JSP)
- Error while trying the update query (ASP)
Other Threads in the JSP Forum
- Previous Thread: Add month in date
- Next Thread: HTTP Status 405 - HTTP method GET is not supported by this URL



Linear Mode