Hi there,
I have seen many examples of JSP accessing the database using JDBC. In all
these cases, the resultset is achieved via "direct" execution of the SQL
statement.
E.g. ResultSet rSet = stmt.executeQuery("insert into tblColor ....");
E.g. ResultSet rSet = stmt.executeQuery("call insertColor....");
Is it possible to access stored procedures via a server command object? I
have an existing code in ASP which I'm going to rewrite in JSP. It calls
stored procedure 'insertColor' and passes the data parameters to it without
having to worry about the SQL statement as in the above example.
--
<%
' This whole chunk to be converted to JSP or jBeans...
dim rs
dim oCmd
' Get database connection...
Set oCmd = Server.CreateObject("ADODB.Command")
With oCmd
.ActiveConnection = dbconn
.CommandText = "insertColor"
.CommandType = adCmdStoredProc
.Parameters.Append
.CreateParameter(,adChar,adParamInput,len(colorCode),colorCode)
.Parameters.Append
.CreateParameter(,adChar,adParamInput,len(colorDesc),colorDesc)
.Parameters.Append
.CreateParameter(,adChar,adParamInput,len(colorStyle),colorStyle)
End With
set rs = oCmd.Execute
%>
--
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets