954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

JSP javascript java string conversion MySQL database

Hi All!

I'm working on a web application, JSP, where a user selects the text with the mouse in html. I want this text to be inserted in a MySQL database as a java string using prepareStatement in Java and executeupdate.

Example:
String querystring = "INSERT INTO mySelectedTextTable(selectedTextWithMouse) VALUES (?)";

selectedTextWithMouse would be a java String, but the selected text is kept on a javascriptvariable.

Any clues on how to convert the javascript variable into a java String?


Thanks in advance.

softDeveloper
Junior Poster in Training
67 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

well .. on my previous projects one of my co workers had to do something similar, and he called the webservice from within his javascript, passing the value as a parameter.
maybe you could google it? by googling 'call a java webservice from javascript' I got a lot of responses, one of them is bound to work for what you try to do.

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

Thank you!

softDeveloper
Junior Poster in Training
67 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You