CKEditor and JSP GET problems

ManifestX's Avatar, Join Date: Mar 2010
Newbie Member
I am quite new to JSP, and I am having some troubles. I am using CKEditor with my JSP code. Everything seems to be okay with CKEditor, but it is when I go to save the HTML in the CKEditor's textarea to the DataBase, it fails and I do not see it in the exception. Or possibly it is not allowing the SQL script enter of '<html>....'?

Name is the name of the file, and template is the html I am inputting into the database, ( i.e. <html><head><body> ).

Here is a snippet of the rf_data.jsp

Code: JSP
String name = request.getParameter("name");
String editor = request.getParameter("editor1");
try {
String connectionURL = "jdbc:mysql://localhost/rems";
Connection connection = null;
connection = DriverManager.getConnection(connectionURL, "root", "root");
if(!connection.isClosed()){ }
Statement stmt = connection.createStatement();
ResultSet rs;
String sql = "'INSERT INTO template VALUES ('" + name + "','" + editor + "')";
rs = stmt.executeQuery(sql);
catch (Exception e)

ManifestX's Avatar, Join Date: Mar 2010
Newbie Member
I have figured it out.
It seems that I have to put in &lt; and &gt; for the < and > tags.
It is not exactly being posted in the database though, but at least I have solved the error I was having.

Unfortunately there is still an error in the connection. Hmmm.
ManifestX's Avatar, Join Date: Mar 2010
Newbie Member
Sorry for tripple posting, but I could not edit.
Though good news. I have found out my problem.
The problem was the SQL string, I have fixed it to the following:

Code: JSP
String sql = "INSERT INTO template ( name, template ) VALUES ('" + name + "','" + editor +"')";

Thanks for your help, anyways.