J
Jason
Hi, I have a simple qustion about JSP and MS SQL server,
String sSQLString = "INSERT INTO testDB(EmployeeID,EmployeeName) ";
sSQLString = sSQLString + "VALUES('" + txtemployeeID + "','" + txtemployeeName +
"')";
then in the somewhere of my jsp,
<% try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
connection = DriverManager.getConnection(connectionURL);
statement = connection.createStatement();
rs = statement.executeQuery(sSQLString);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (rs != null) rs.close();
if (statement != null) statement.close();
if (connection != null) connection.close();
} %>
then after that JSP page executed, there is no any error message showed up, but
after I opened "query analyzer" from MS SQL, the data I just typed did not
save(insert) into database, but if I execute that query directly, it's works.
So, is there someting wrong on my code?
Thanks in advance.
Jason
String sSQLString = "INSERT INTO testDB(EmployeeID,EmployeeName) ";
sSQLString = sSQLString + "VALUES('" + txtemployeeID + "','" + txtemployeeName +
"')";
then in the somewhere of my jsp,
<% try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
connection = DriverManager.getConnection(connectionURL);
statement = connection.createStatement();
rs = statement.executeQuery(sSQLString);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (rs != null) rs.close();
if (statement != null) statement.close();
if (connection != null) connection.close();
} %>
then after that JSP page executed, there is no any error message showed up, but
after I opened "query analyzer" from MS SQL, the data I just typed did not
save(insert) into database, but if I execute that query directly, it's works.
So, is there someting wrong on my code?
Thanks in advance.
Jason