Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!

Sridhar Srikanthan

Ranch Hand
+ Follow
since Jan 08, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sridhar Srikanthan

Hi Friends,
I have been having a problem with tomcat-apache integration such that all the web requests that are received by apache web server are forwarded to the tomcat 5.5 server. I have read about APJ connectors but could not make it work since I could not find any authoritative document. My problem is compounded by the fact that every document I find has a different version of apache and tomcat.
I would be thankful to anyone who could either point me / send me a document which works for them.

TIA
Sridhar
12 years ago

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;
}

%>




You are calling the stored proc with three parameters
("{?= call tc_sp(?, ?, ?)}"); but setting four parameters,


cs.registerOutParameter(1, Types.VARCHAR);
cs.setString(2, customertype);
cs.setString(3, username);
cs.setString(4, password);


you have to have the same number of parameters if the stored proc has to run and return some value.

Thanks
Sridhar

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.



This was exactly the reason why we got Broken Pipe Exception. We accidentally set the inactive connection timeout for the connection pool in weblogic 8.1 as 10 seconds.

According to the published functionality, weblogic is supposed to return the connection object back to the pool but it wouldn't do so and from hear-say , I need to install a new patch (since weblogic acknowledged that its a bug).

The temporary working solution is to change the inactive timeout to zero and that works like a charm !!!

We have seen this problem far too often and no one seems to know the exact reason. I hope this explanation adds on to Kolkata Prince's initiative.

Thanks
Sridhar
Ashish,
Thanks for the reply. I am presently using WLS 8.1. I understand what you are suggesting. But our scenario is a bit different. We have configured a foreign JMS Server with a local jndi name pointing to remote jndi connection factory( This is a new feature available with WLS8.1). This setup in admin console doesnt have options to set redelivery limit and error destination. (If we set up a local jndi connection factory, we can use the options on the admin console to set redelivery)
If you dont understand my problem, i can be more specific
Thanks
Sridhar
[ November 18, 2003: Message edited by: Sridhar Sri ]
16 years ago
There is a server/lib directory inside weblogicXX(where XX means the version) directory. If you place your lib files there, you need not add it to classpath. If you add it in a directory other than that ones in your classpath, then u need to add it this way
CLASSPATH=/server/lib:$CLASSPATH
export CLASSPATH
Hope this helps
Sridhar
16 years ago
Hi Sunitha,
Put all the jar files in the lib directory or in a separate directory.
If you put it in a different directory, include the classpath in startWebLogic.cmd (for windows) and startWebLogic.sh(unix)
HTH
Sridhar
16 years ago
Navjeet,
Thanks for the reply. We have withdrawn the idea of implementing a bridge. We have infact configured the setup using the Foreign JMS Provider option.
We have been able to implement XA but have some issues. I will be grateful to you if u can offer your valuable advice on those.
1) When we receive a bad message ( can be just a formatting issues or a poison message), we are using messageDrivenContextInstance.setRollBackOnly().
The problem is we are unable to set any redelivery limit or error destination as there are no options in admin console. There must be some way to do it but I am not sure where to get the documentation from.
2) This issue involves the consumer processing when a required resource for the transaction is not available ( like a database). How do u go around the problem of resetting the message to be redelivered again after a small interval ?
Thanks in advance
Sridhar
16 years ago
Padam,
How can i reach you to know more abt Messaging bridge between Weblogic and MQSeries using XA
THanks in advance
Sridhar
16 years ago
Hello Friends,
Has anyone worked on bridging the Weblogic JMS Provider with MQSeries JMS provider through a WL Messagin Bridge? If yes, have you encountered any problems with the transaction manager( weblogic container) ?
I have a problem in implementing container managed transactions on an MDB in WLS because MQSeries doesnt seem to support two-phase commit. Any inputs on this issue will be highly appreciated.
Thanks
Sridhar
16 years ago
Congrats Dhriti,
Good work.
Sridhar
Friends,
I was wondering about what app server you guys have been using to practice for SCBCD? I just hope (and believe its true ) that the exam is verndor independent.
Sridhar
Hi,
EJB Specification has a separate chapter dedicated for deployment descriptor.
Hope this helps
Sridhar

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

16 years ago
Hi Ranchers,
I passed my SCWCD exam today with 88%.
unlike SCJP,this exam tests more of your memory than your conceptual skills.
I was an active participant when I prepared for SCJP but this time it was all hush-hush
Just go through the SCWCD study kit and it will get u through the exam with flying colors
I gained a lot of valuable inputs from the JavaRanch site itself in general and this forum in particular. I wish to thank all of you for making this place a pleasurable outing.
Thanks
Sridhar
16 years ago