Paul Clapham

Sheriff
+ Follow
since Oct 14, 2005
Paul likes ...
Eclipse IDE Firefox Browser MySQL Database
Vancouver, Canada
Cows and Likes
Cows
Total received
46
In last 30 days
0
Total given
89
Likes
Total received
2333
Received in last 30 days
25
Total given
483
Given in last 30 days
14
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Clapham

Caused by: java.net.ConnectException: Connection timed out: connect



This error message suggests that the database server is running, but that it does not respond to your connection request for a very long time. You could check with the person responsible for the database to find out what's going on.
Hi jaedon, welcome to the Ranch!

You're right that it's simple (or fairly simple, anyway). So let's start: what part of the code do you think is calculating the highest value? You'd need to change that code to calculate the lowest value.
15 hours ago

java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection`enter code here



That bold-faced part is from your code, isn't it? Was it supposed to be replaced by the actual connection information?
Thanks Stanley, and welcome to the Ranch, both of you!

Ralf Coby wrote:Yeah, that's what i wanna want to do.
The problem is, that my cipher-bytearray only accepts 128 fields.
So, I first tried to save the "128 fields" in an Arraylist, which should be one package.
Like: b.get(0) is equals to byte[128].



It would help if we knew what you meant by a "field" and a "package".
20 hours ago
Because you can implement more than one interface, whereas you can't extend more than one abstract class.

Mo Alexwainy wrote:Also, the below js runs anytime in my servlet whenever i execute it. It does not run at anytime later on.

out.println("<script type=\"text/javascript\">");
out.println("document.getElementById('myBody').innerHTML = '';");
out.flush();



No, it doesn't. The Java code which you posted there of course runs every time you execute the servlet. It generates that JavaScript code and sends it as part of the response.
That format is totally irrelevant to your question. It's just how the JTable chooses to display your date. That is... provided you actually put Date objects into the table, and not formatted Strings which represent dates.
1 day ago
And in your previous thread you said you were compiling this with Java 8, but then you said something about Java 7. So make sure you're compiling with Java 8.
1 day ago

omar tawfeek wrote:can you give me an example how to get difference between date using Jdatechooser , when i always subtract date 2 to date 1 , i always get an error saying date cannot be converted to int .



No. You wouldn't use a JDateChooser to get the difference between two Date objects.

You know that a Date object doesn't represent a Date, right? It represents a particular instant of time, to the nearest millisecond. So again, you'll have to decide what you mean by the difference between two Date objects. The number of milliseconds between those two instants of time? Or perhaps the number of days which those milliseconds make up? If you don't want to deal with all those annoying details and you just want to deal with days, then, again, I suggest you use a LocalDate from the java.time package.

also can JTable1.getValueAt method get the date format from table or it can only get number values ?



The getValueAt() method returns an Object, namely the object which is stored at that position in the table's data model. If you put a Date into the data model then you can cast the result of getValueAt() to Date, but if you put some other thing derived from the Date into the data model then you can only get that other thing out.

I don't understand what you mean by "date format".
1 day ago

Mo Alexwainy wrote:This is a snipet from my servlet.

There is a loop that generates a percentage value.

LOOP STARTS

The input textbox stores the percentage value.

This is done successfully.

Right after the text box, i have called a js where it gets the percentage value from the textbox.

LOOP ENDS.



No, that isn't what happens. The Java code in your servlet runs and writes out that JavaScript code. (See Ron McLeod's post which shows you what is written.) Note carefully: it writes out that Javascript code. At some time later the JavaScript code appears in your browser, and the browser may cause it to be executed at that time.
kennith stomps,
Your post was moved to a new topic.
(This informational message will self destruct in two days)
1 day ago
If you want to store a Date in a JTable cell, then just store the Date there. Don't convert the Date to a String; better still, don't use a Date but use a LocalDate.

And if you want to find the difference between two dates (whatever you mean by that) then it doesn't matter whether the two dates are in JTable cells or database columns or HashMap keys or anything else. Just create two Date variables and get them to refer to the two Date objects in question.

But probably your question is mostly how to find the difference between two Date objects, and you're getting confused by the act of getting those two Date objects from wherever you put them. So, once you have got them available to your code, you have to decide what you mean by the difference between those two Date objects.
1 day ago
As for what "thread-safe" means in Java, you could read this page: What does the term "thread safe" mean in Java?. Then you could have a look at the API documentation for ConcurrentHashMap and try to determine whether it follows that definition.