Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Pooja Agarwal

Ranch Hand
+ Follow
since May 19, 2004
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 Pooja Agarwal

Hai All,

Thanks every one and i appreciate each one of u for ur advice.

Actually i was trying to look up in a jdbc program and tried to run it. Came to know that if i try to run this from DOS console as an external program i must specify the properties.

But when tried the same code in a servlet which is deployed in the weblogic server it worked fine.

SO some thing deployed in the weblogic need not specify these properties. If running as an external client code these properties must be specified. Am i right ???

Thanks once again,
I am thankful to each one of u.
Pooja.
Hai Ankur and Paul,

Thanks for ur replies.
Can u plz let me know how to set VM param or use config file inorder to set these properties. I am struggling as i am new to weblogic and connection pooling concept.

So after making the WAR file if the port is changed i have to mention that in the config file so that my java code reads the port from config file. And there is no way with out which it can get the port number.

For connection pooling in weblogic are these parameters a must?. This question seems to be stupid after all these explanation but i have seen some code where there is nothing related to those ht.put() statements but still the code works fine. No config file or VM params. Is what i have seen is true.

Thanks a lot and i appreciate ur help.
Pooja.
Looking for some help !!!
Any help is appreciated.

Thanks
Pooja
Hai All,

I am facing a problem in getting the database connection from a connection pool created on weblogic server 8.1.

I am using the Oracle database 8.1.7.

I have configured my connection pool, datasource and JNDI in weblogic.
In my java program i have the following code to retrieve the connection.




The above code is working fine but, the two ht.put statements are creating problem.
The problem is, after converting the application into WAR file it can be deployed
on any machine or different port on same machine. My application fails if its deployed on
weglogicserver which is at different port.

Is there any way that i can get rid of those ht.put statements or any other way to solve the problem.
any help is appreciated.
Thanks in advance
Pooja.
Hai

Firstly, thanks for ur reply.
Is there any way to overcome this and get the path.
What do i need to do inorder to retrieve the path.
Is there any solution.

Thanks once again,
Pooja.
17 years ago
Hai All,

I am facing problem in retriving the realpath from the servlet.
I am using the following code in order to retrieve the path.
String prefix = getServletContext().getRealPath("/WEB-INF/classes");

The value returned from above code is null.
I am using Weblogic 8.1 server, and deploying my servlet as WAR file inside
the weblogic server.

Is this the problem with the weblogic server or with the code. Is there any way to over come this.
I need the path as i am implementing Log4j for the servlet and i have to pass the
configuration file in one of the function "PropertyConfigurator.configure(file);"
where the file should include complete path.
My configuration file is in WEB-INF/Classes directory.

Any help is appreciated.
Thanks in advance
Pooja.
17 years ago
Hai Jeanne Boyarsky

You are rite, there is no need to pass connection object as well.
I will obtain it in the JDBC class.

Thanks for ur advice.
I appreciate ur help
Hai All,

I need an advice in JDBC coding !!

In my project i need to write a servlet which parses an XML,
retrieves values of XML and invokes stored procedures using those values.

My servlet uses a Parserclass method
Map parsexml(string str) to parse the data. This method parses the data and return the parsed values as a HashMap.

My problem is ... i am not sure where to include my JDBC code to execute the stored procedures.

1) Should i write the jdbc logic in a method of the parserclass itself
[or]
2) should i write one more class which takes care of jdbc stuff
[or]
3)should i include the jdbc code in servlet.

I am using weblogicServer8.1 for the application and jdbc connection pool inorder to get the connection object.
I think if i have to use some other class to handle jdbc stuff, i should be passing this connection object to other class

methods.

I would like to know whether my approach is correct or not.
What would be the best approach in my cenario.
I am not able to properly judge as i am new to this.

Any help is appreciated,
Thanks in advance,
Pooja.
Hai Blake,

Thanks a lot for ur code, its very simple to use and i guess its more appropriate in my situation.
But unfortunately the problem still exists, i.e the transaction is not getting rolled back. I guess there is some problem with my 5th stored procedure and not with the code. Its commiting some where in the 5th stored procedure.

I have tried to execute the stored procedures from TOAD and got the same result, ie transactions are getting commited though the 5th SP returns non zero value, hence deduced that there is a problem in 5th SP.

Thanks a lot for ur sample code which really helped me in making my code simple and readable.
Thanks once again and i appreciate ur help.
Pooja
Hai All,

I am posting the same question as i did not receive any reply to my earler post. Plz excuse me.

I am finding diff in rolling back some transactions.
Actually in my application (ie in Servlet) i have 5 callable statements to execute 5 stored procedures.
cstmt1,cstmt2,cstmt3,cstmt4,cstmt5
I have one connection object.

I have to execute these stored procedures in sequence. If any stored procedures returns non zero value i have to stop

execution and roll back all the transactions.
If all the 5 stored procedures return 0 then i have to commit the transaction.
i have used the following logic to do so.
But the problem is, i am failing to rollback the tranaction.
SP5 is returning non zero value, its displaying "error in SP5", but
is not rolling back all the transactions. Plz let me know how to roll back all the transactions.
Is there any mistake in my logic. ??

SP2 and SP3 are executed more than once and are included in for loop.

SP = Stored procedure.




Any help would be appreciated.
Thanks in advance
POOJA.
Hai All,

I am finding diff in rolling back some transactions.
Actually in my application (ie in Servlet) i have 5 callable statements to execute 5 stored procedures.
cstmt1,cstmt2,cstmt3,cstmt4,cstmt5
I have one connection object.

I have to execute these stored procedures in sequence. If any stored procedures returns non zero value i have to stop

execution and roll back all the transactions.
If all the 5 stored procedures return 0 then i have to commit the transaction.
i have used the following logic to do so.
But the problem is, i am failing to rollback the tranaction.
SP5 is returning non zero value, its displaying "error in SP5", but
is not rolling back all the transactions. Plz let me know how to roll back all the transactions.
Is there any mistake in my logic. ??

SP2 and SP3 are executed more than once and are included in for loop.

SP = Stored procedure.


Any help would be appreciated.
Thanks in advance
POOJA.
Hai Boyarsky,

Thanks for ur reply, do i need to import any specific packages related to weblogic, any classpaths to set ???
Plz let me know abt it.

thanks once again
Pooja
You need to change this line.



Give the IP address of the system on which the oracle is running.
if its on ur system give localhost as the IP adderss


and make sure the db name is COFFEEBREAK, and user name and pwd are correct.
Hai All,

I am new to weblogic database connection pooling.
I am using Weblogic8.1 and want to use connection pooling to get a jdbc connection. my database server is Oracle 8.1.7.

Things which i have done using the weblogic admin console.
----------------------------------------------------------

I have created a Jdbc connection pool named myconnectionpool.
I have created a datasource named mydatasource.
and named the JNDI as myjndi.
Is the above process correct to create the connection pool in the weblogic8.1.

I am not aware of the java code to get the database connection object from the connection pool which i have created.
can any one please let me know the java code to get the connection from the pool.

Any help is appreciated
Thanks in advance
pooja.
Hai

Thank you !!!
Thanks a lot for ur reply.
I appreciate ur help.

pooja.