Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A question about use interbase store procedure in jsp.

Status
Not open for further replies.

tengyong

Programmer
Oct 14, 2002
2
CN
I've written a jsp ,a bean and a Interbase store procedure .Here is the content of my bean ---

---------------sql_data.java-------------------

package com.bigchina.jdbctest;
import java.sql.*;

public class sql_data
{
String sDBDriver = "interbase.interclient.Driver";
String sConnStr = "jdbc:interbase://localhost/D:/tomcat4/webapps/aaa/data/TEST2.gdb";
Connection conn = null;
ResultSet rs = null;

... ...

public void thetest(String pa1,String pa2,String pa3,String pa4)
{
System.out.println(pa1);
System.out.println(pa2);
try
{
conn = DriverManager.getConnection(sConnStr,"SYSDBA","masterkey");
CallableStatement cstmt = conn.prepareCall("{call TTT(?,?,?,?)}");
cstmt.setString(1,pa1);
cstmt.setString(2,pa2);
cstmt.setString(3,pa3);
cstmt.setString(4,pa4);
cstmt.executeUpdate();
}
catch(SQLException ex)
{
System.err.println("sql_data.executeUpdate: " + ex.getMessage());
}
}

------------------------------------------

Here is the content of my jsp page ---

------------------------test.jsp------------------

<%@ page contentType=&quot;text/html;charset=gb2312&quot; %>
<%@ page language=&quot;java&quot; import=&quot;java.sql.*&quot; %>
<jsp:useBean id=&quot;searchdb&quot; class=&quot;com.bigchina.jdbctest.sql_data&quot; scope=&quot;page&quot;/>
<html>
<head>
<title>test</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot;>
</head>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<%
searchdb.thetest(&quot;2222&quot;,&quot;DDDD&quot;,&quot;DDDDDD&quot;,&quot;FFFF&quot;);
%>

------------------------------------------
Here is the content of my Interbase store procedure ---

------------------------TTT------------------

CREATE PROCEDURE &quot;ttt&quot; (
PBID VARCHAR(20),
PBNAME VARCHAR(36),
PBCITY VARCHAR(20),
PBTEL VARCHAR(30))
AS
BEGIN

Insert into phbook
VALUES:)PBID,:pBNAME,:pBCITY,:pBTEL);
SUSPEND;
END

------------------------------------------

When the jsp run ,Tomcat display----

sql_data.executeUpdate: [interclient][interbase] Dynamic SQL Error
SQL error code = -204
Procedure unknown
TTT

I don't know how to do.Please help me.Thank you!

PS:My english is poor ,sorry.^_^



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top