Kareem Qureshi

Ranch Hand
+ Follow
since Mar 14, 2002
Merit badge: grant badges
For More
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 Kareem Qureshi

Hi,
I think this might help you.
Thanks
Kareem

There is one problem with connection pooling. A web application has to explicetely close ResultSet's, Statement's, and Connection's. Failure of a web application to close these resources can result in them never being available again for reuse, a db connection pool "leak". This can eventually result in your web application db connections failing if there are no more available connections.

There is a solution to this problem. The Jakarta-Commons DBCP can be configured to track and recover these abandoned dB connections. Not only can it recover them, but also generate a stack trace for the code which opened these resources and never closed them.

To configure a DBCP DataSource so that abandoned dB connections are removed and recycled add the following paramater to the ResourceParams configuration for your DBCP DataSource Resource:


<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>




When available db connections run low DBCP will recover and recyle any abandoned dB connections it finds. The default is false.

Use the removeAbandonedTimeout parameter to set the number of seconds a dB connection has been idle before it is considered abandoned.


<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>




The default timeout for removing abandoned connections is 300 seconds.

The logAbandoned parameter can be set to true if you want DBCP to log a stack trace of the code which abandoned the dB connection resources.


<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>




The default is false.
Hi,

It looks like you are not closing the connection once they are created.Or I didnt see the code where you are closing the connections.
I would write a finally block after all the exception handling and then close connections there so that they are returned to the pool to be used again.

Hope this helps.

Thanks
Kareem

select * from tablename1, tablename2
tablename1 and tablename2 are two different tables with different schemas.


if you mean they belong to two different databases then
You cannot do a select on two different schemas.

Hope this clarifies

Thanks
Kareem
Hi,
Distances is an Object. You will have to override the toString() to get the String format of your answer.

for example
public String toString(){
String actualDistance = miles+" miles, "+yards+" yards, "+feet+" feet";
return actualDistance;
}
add this method to Distance class and
You can modify main() System.out.println(Distances.convertYards(6002).toString())

or

//this will print on the Console
System.out.println(miles+" miles, "+yards+" yards, "+feet+" feet");
add this as the last line in your convertYards() method.

Hope this helps.

Thanks
Kareem
19 years ago
Hi,

From the way I am understanding your problem. You have to set the part name to get it where ever you need it.

More information would be helpful in giving a better answer.

Thanks
Kareem
19 years ago
lin,

J2EE Best Practices using a Real-Life Example by Carol McDonald.
It is webinar. unfortunately I dont have the link but a google search could help you.

Thanks
Kareem
I am using common code for two beans. As Damanjit said each bean will have its own DD files.

Kareem
Joe,

Java implements what is known as a single-inheritance model.

This means that when someclass is not extending from any other superclass then it is extending from Object class by default, but if it is extending from a superclass which is in turn extending from Object class by default. That means someclass is also extending from Object class

I would want to see what others think.

Thanks
Kareem
19 years ago
I think your if condition is wrong
it should be if (no >10 && no <20 ) instead of if (no >10 || no >20 )

Hope this helps
Thanks
Kareem
[ March 29, 2005: Message edited by: Kareem Qureshi ]
19 years ago
You can use a logger to write.
I think if you want to write your method name inside the method then you have to use the reflection.

example
(you need a logger to write it like java.util.logger)
//if hello is the only method then this code would do
somelog(this.getClass().getMethods()[0].getName()

but if more than one method then is it little bit complicated. I will not confuse you more but If you do need to know more let me know.

Hope this helps
Kareem
19 years ago
Hi,
I tried everything they say on the site. I am not sure if it is the SQL server settings are the problem or something else like they want the DTC proxy to run port 1434?

I am trying to get their support.

Thanks
Kareem
Hi,

log4j is now java.util.logging so you should be able to do it using properties files.

Thanks,
Kareem
19 years ago
Hi,

This can also happen when an attempt is made to open a read-only file for writing.

Hope this helps.

Thanks
Kareem
19 years ago
I need to know how to set up the XA connection pool for XADataSource.

I have dowloaded the Merlia driver from INet and ran the DTCProxy.exe on the SQLServer and have Merlia.jar on the server classpath.

I have created the TestXAConnectionPool using the Admin console but I am getting a Distributed Transaction Error, Connection refused: connect error.
I have checked the user name and password they are correct.

Basically I need to help in setting up XADataSource using Merlia Driver, SQLServer2000 on Weblogic 8.1 sp2 server. Also have the Distributed Transaction Coordinator running on SQLServer.

I am sure there are many users using the above but I am not sure what else is I need to do other than above?

Thanks
Kareem
You can do it even better by defining getter and setter methods on your variables and the code will be cleaner.
Let me know if you still need help.

Thanks
Kareem
19 years ago