tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karthikeyan .K.V" <karthi...@attbi.com>
Subject RE: Help in JSP
Date Sat, 09 Mar 2002 04:34:00 GMT
Think  use  the "output=" statement before u use  the close function
statement.

Karthik

-----Original Message-----
From: Neo Gigs [mailto:gigsvoo@yahoo.com]
Sent: Friday, March 08, 2002 9:53 PM
To: Tomcat Users List
Subject: Help in JSP


Hi there all,

I had a JSP page that talks to a JBeans, but the problem is my Bean is
actually doing DB connectivity to a Oracle db, as no result returned from
the Bean.

As I had tested with the application of the same codes.

Could anyone help me to scan thru, whats wrong with this?

package com.mbf.beans;

import java.sql.*;
import java.math.*;
import java.io.*;
import oracle.jdbc.driver.*;

public class SpTest
{
    private int interString;
    private String output;

    public String getInput()
    {
        // First detect class existance
        try{
            Class.forName("oracle.jdbc.driver.OracleDriver");
        } catch (java.lang.ClassNotFoundException e){
            System.err.print("Class Not Found error!" + e.getMessage());
        }

        // Now try to open db connection and do the fetching
        try{
            // DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
            String url = "jdbc:oracle:thin:@10.97.2.50:1521:REL4";
            String scall = "begin sp_GetClatTypeIE(?, ?); end;";
            Connection conn = DriverManager.getConnection(url, "tux",
"tux");
            CallableStatement cs = conn.prepareCall(scall);
            cs.registerOutParameter(2, Types.VARCHAR);
            cs.setInt(1, interString);
            cs.execute();
            cs.close();
            conn.close();
            output = cs.getString(2);
        } catch (SQLException e) {
            System.err.println("Error: " + e.getMessage());
        }
        return output;
    }

    public void setInput(String s)
    {
        // Here to assign input parameters
        interString = Integer.parseInt(s);
    }
}

Thanks

Regards,

Neo Gigs
========
VB?
http://communities.msn.com.my/VisualBasicwithNeo
http://www.vbcity.com/forum
http://www.vbweb.co.uk
Get paid cash receive email?
http://www.MintMail.com/?m=1414418
Reading SMS got paid?
http://www.dynamicsms.com.au/intro.asp?ref=0123502385&refc=348
Malaysianshop.com http://www.malaysianshop.com
More Traffic?
http://www.exitblaze.com/cgi-bin/intro_track.pl?b=25924&c=xbad1
================================================
Note:This is intended to addressees only, if you wanna be removed, let me
know.



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message