tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neo Gigs" <gigs...@yahoo.com>
Subject Help in JSP
Date Sat, 09 Mar 2002 03:52:45 GMT
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. 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message