In a Java web application I am working on, we are using OracleConnectionPoolDataSource for a database connection pool functionality. Each getConnection call includes the user's Oracle ID and password. So each user in a sense ends up with their own database connection pool.
Currently we are using the default values for most properties. T...
May I know what is the difference among lazySet and set method for AtomicInteger. javadoc doesn't talk much about lazySet :
Eventually sets to the given value.
It seems that AtomicInteger will not immediately be set to the desired value, but it will be scheduled to be set in some time. But, what is the practical use of this method? Any...
Hi, I'm using the following code
st = connection.createStatement(
ResultSet.CONCUR_READ_ONLY,
ResultSet.FETCH_FORWARD,
ResultSet.TYPE_FORWARD_ONLY
);
st.setFetchSize(1000);
System.out.println("start query ");
rs = st.executeQuery(queryString);
System.out.println("done query");
The query return a lot of (800k...
I am trying to pin down a memory leak problem for my standalone Java program that runs on unix. I have the port and params setup such that I can connect to it using JMX with JConsole or VisualVM already.
Those help a little but unfortunately it doesn't tell you where the memory has gone, it only tells you how much memory is used. I'm l...
I am constantly reading about how much Cobol code is still in production. And the main reason that it hasn't been updated into am more modern language is that it would take too long/cost too much.
My question is: If there was a tool that converted Cobol to, say, Java, would any organizations find it useful? Or would they rather continu...
I'm using a JSlider to show progress in my application, so that it updates as a certain process computes.
I want a user to be able to drag the thumb backwards to a tick mark in the past, but when this happens, I want the progress indicator to remain at its current position.
// A dismal attempt at drawing the situation
Progress: ------...
Hello,
I have a client set up to send a request to the National Weather Service SOAP server. I am receiving the response that I expect, but I am unsure as to the best way to extract the data from it that I need.
For example, there is a lot of extra data in the XML (in the SOAPBody), but I only want to grab the data for the parameters t...
I want to save a Date object to a readable string (for example 22/10/2009 21:13:14) that is also parsable back to a Date object.
I have tried many things and the best I could find was to use DateFormater for parsing and formating but it has a setback. When you format a date you lose seconds information. I tried to find if there is an op...
I'm working with some existing code, trying to add to it and increase the unit tests for it. But running into some problems with getting the code testable.
Original Constructor:
public Info() throws Exception
{
_ServiceProperties = new ServiceProperties();
_SshProperties = new SshProperties();
}
I'm aware that this is bad, and ob...
I really want to create a subclass of FutureTask that has a default no-arg constructor. In particular, I want my subclass to implement the Callable interface and use itself as the callable. This way, users of MyFutureTask can just subclass MyFutureTask instead of having to implement their own callable and pass it to an instance of Futu...
Any idea why I am getting this exception?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myService' defined in class path resource [context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type...
Say I want to add a note to a specific future firing of a CronTrigger in Quartz.
Is it possible to identify a specific future firing in such a way that I can give other objects a reference to it?
...
Hi all,
There's a statement in the ejb-3_0-fr-spec-persistence.pdf which reads
The persistence context is not synchronized with the result of the bulk update or delete
So if I do a query.executeUpdate which deletes rows from a table. Those same rows still exist in another entities one to many collection. When I restart the applicatio...
Here's the situation, I have a jFrame with a tabbed pane and within the tabs I have a couple of jTables and a jTree. I want to be able to chain the selections between the tables and the tree based on whether a user uses a ctrl/shift + click versus a regular click. (If you hold ctrl and click in the first table/tree, it adds to the over...
Dear all,
I need to apply an SQL query to CSV files (comma-separated text files). My SQL is predefined from another tool, and is not eligible to change. It may contain embedded selects and table aliases in the FROM part.
For my task I have found two open-source (this is a project requirement) libraries that provide JDBC drivers:
CsvJ...
Hi. Does anyone know whether it is possible to run mvn exec:java on mvn aggregate POM?
Currently I get:
2009-09-24 02:24:14.404 :bash: karolrvn@karolrvn-laptop : ~/adfadf/programming/verknowsys/codadris/ide_projects $ mvn exec:java -e -Dexec.mainClass=codadris.coviob2.App_Coviob2
+ Error stacktraces are turned on.
[INFO] Scanning for...
For instance in Sept I would need:
1,8,15,22 and 29
Thanks
...
We have recently attached a GWT MenuBar to a part of our application for, well, menu purposes.
Basically I want the sub menus to open when you mouse over the top level menu, which is easy enough to do:
menubar.setAutoOpen(true);
I would also like to have the sub menu automatically hide when the user's mouse leaves the sub menu. Ideal...
The database has data in UTC and when I try to get data
java.util.Calendar cal = Calendar.getInstance();
cal.setTimeZone(TimeZone.getTimeZone("UTC"));
java.sql.Timestamp ts = resultSet.getTimestamp(PUBLISH_TIME);
cal.setTime(ts);
Is there anything wrong with this?
...
I have 2 set of unsorted integers: set A and set B. But we don't know how many items are there in setB in advance.
I need to :
while setA and setB are not empty:
pop the smallest no from setA
move an int from setB to setA
What is the most efficient way to do that in Java?
I am thinking
create an ArrayList for setA and Link...