Shilohcity
Technical User
Hello
I am trying to run a SQL Server stored procedure from a JSP page and just cant seem to figure out how to do it. I am communicating fine with the d/base and running standard SQL queries with no worries so I think it is just the syntax I am a bit unsure of.
I am a little confused over callable statements etc and also how to obtain a recordset from a stored procedure.
At present my working code looks like this:
Driver MM_driver = (Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDriver".newInstance();
Connection myConn = DriverManager.getConnection("jdbc:weblogic:mssqlserver4:web_test@mydatabase",MM_editUserName,MM_editPassword);
Statement stmt = myConn.createStatement();//(MM_editQuery.toString());
ResultSet myResultSet = stmt.executeQuery("select * from test_table"
if (myResultSet != null)
{
while (myResultSet.next()) {
String eid = myResultSet.getString("id"
%>
hello<%= eid %>
<%
}
}
myConn.close();
}
}
%>
All help and suggestions most appreciated in my time of need.
Thanks
Justin. X-) "Creativity is the ability to introduce order into the randomness of nature." Eric Hoffer
Visit me at
I am trying to run a SQL Server stored procedure from a JSP page and just cant seem to figure out how to do it. I am communicating fine with the d/base and running standard SQL queries with no worries so I think it is just the syntax I am a bit unsure of.
I am a little confused over callable statements etc and also how to obtain a recordset from a stored procedure.
At present my working code looks like this:
Driver MM_driver = (Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDriver".newInstance();
Connection myConn = DriverManager.getConnection("jdbc:weblogic:mssqlserver4:web_test@mydatabase",MM_editUserName,MM_editPassword);
Statement stmt = myConn.createStatement();//(MM_editQuery.toString());
ResultSet myResultSet = stmt.executeQuery("select * from test_table"
if (myResultSet != null)
{
while (myResultSet.next()) {
String eid = myResultSet.getString("id"
%>
hello<%= eid %>
<%
}
}
myConn.close();
}
}
%>
All help and suggestions most appreciated in my time of need.
Thanks
Justin. X-) "Creativity is the ability to introduce order into the randomness of nature." Eric Hoffer
Visit me at