PDA

View Full Version : JDBC call from a JSP


Nimda
03-25-2003, 01:59 PM
Slightly off-topic, but have a web development question. I have a need to access a database from a JSP file and dynamically generate VXML code as a response. I have a sample JSP that is just doing some basic logic to check an account number and sends back some basic info. I have created an ODBC data source on my laptop to an mdb file (attached) and want to take as input not just an account number, but also a PIN. Then, the JSP should be able to query the database to check that a valid PIN was provided for the account number, then attach the proper balance. I am thinking I MAY need to have a .class file in the background that the JSP links to for the JDBC call, but am not sure. Anyone know how to do this? The sample static JSP is pasted below...

I am using Tomcat as the web server on Win2000 Professional if it makes any difference. I can successfully fetch the VXML file from my web server, do speech recognition on the account number, and pass it to the JSP below for info to be played back as of right now. Just need to take it to next step to verify a DB and assign values.

Thanks!

<--
<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">

<var name="status" expr="1" />
<form id="acct_information">
<block>
<assign name="status" expr="


<% String acctNum = request.getParameter("ACCTNUM");
if(acctNum.equals("111111111")){
out.println("'OK'");
}
else {
out.println("'PastDue'");
}
%>
" />
<assign name="balance" expr="1000.56" />
<return namelist="status balance" />
</block>
</form>
</vxml>
-->