Originally posted by bala kiran:
How do I call SQL Server Stored Procedure from Jsp? This is the code snippet I'm using. This should return me some string value "abc". But, its returning me a numeric zero. Where i'm doing wrong? Its not throwing any exception.![]()
<%@ page import="javax.ejb.*,java.sql.*,javax.naming.*,javax.sql.*" %>
<%
InitialContext initialcontext = null;
DataSource datasource = null;
Connection connection = null;
PreparedStatement ps = null;
ResultSet rs = null;
CallableStatement cs = null;
String username = "user";
String password = "password";
String customertype = "A";
try {
initialcontext = new InitialContext();
datasource = (DataSource)initialcontext.lookup("db");
connection = datasource.getConnection();
cs = connection.prepareCall("{?= call tc_sp(?, ?, ?)}");
cs.registerOutParameter(1, Types.VARCHAR);
cs.setString(2, customertype);
cs.setString(3, username);
cs.setString(4, password);
cs.execute();
out.println("result is: " + cs.getString(1));
} catch(Exception e) {
out.println("exception occured : " + e.toString());
} finally {
if(connection !=null) connection.close();
connection= null;
}
%>
Originally posted by kolkata prince:
c) The Pool has multiple connections, and due to timeout or any other reason, one of the connection would go dead but the application server is still trying to use the dead connection to connect and execute the Stored Procedure, and hence getting a broken pipe error.
if anyone could have more reasons or any solutions, its welcome.
Originally posted by Eleison Zeitgeist:
We all know what the general consensus of Idians .... "Damn those Stupid, Arrogant Americans... look at what they are f*cking up in Iraq now... thank GOD WE are not as stupid as THEM... we Indians may not have the most money, buildings, etc... However, we are smart enough to know that going into IRAQ is a stupid idea... Outside we may not be superior to them, but inside we are superior and thats where it counts.."
Can you supply me with a pertinent link which gives u what the general consensus about the Indians is?
Just because a person is an idiot does not make a country Idiot....
It will serve no purpose to blame a country
Sridhar