savas karabuz

Greenhorn
+ Follow
since Feb 24, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by savas karabuz

Hi,

Where are the icons used by DefaultTreeCellRenderer stored on computer?

Thanks in advance...

...Savas...
[ July 22, 2004: Message edited by: savas karabuz ]
20 years ago
Hi all,

Suppose a thread opened a connection to a database and acquired an exclusive lock on a table to delete some rows.

What happens when a second thread tries to select a row from that locked table(or to update a row of the table) before the first one releases the lock by a commit or rollback?

Does it wait for the lock of the table to be released(namely,blocks?), does it throw an exception, or something else?

Thanks in advance...
Hi all,

I want to know whether there is any difference between the following scenarios in a multi-threaded environment :

Say we have a function aMethod() that can be executed by more than one thread at a time in a class whose pseudo-code is something like :


Now, AFAIK insert and delete operations in aMethod() requires obtaining exclusive locks on the respective tables, so no one thread can ever insert into table A before its lock is released by the owning thread with a commit or rollback; effectively there is always only one thread executing inside aMethod() ant the other threads are waiting for the locks to be released. Am i right?

Is this situation the same with the following scenario, where access to aMethod() is synchronized? Here, still no two threads can be in aMethod() simultaneously, right?


Thanks in advance...
Hi,

We have a web application deployed on an iPlanet web server v4.1. Sometimes we get IllegalStateExceptions at the method call com.netscape.server.http.session.SimpleSession.getId(). In order to track the issue, we have added println statements to see whether a timeout occurred or not. Following is what we saw for the latest exception :


Current Time : Thu Jun 17 13:16:35 EEST 2004
Session Creation Time : Thu Jun 17 13:16:28 EEST 2004
Session Last Accessed Time : Thu Jun 17 13:16:35 EEST 2004
Session Maximum Inactive Interval Setting : 43200000



So, we deduce that the reason was not a session timeout. Is there any way for a session to cause those IllegalStateExceptions other than timeout and deliberate usage of calls in the application?

Any bit of help is appreciated.

Thanks in advance...
20 years ago
Hi all,

From time to time httpd.exe process uses nearly 650 MBs of memory according to task manager on a Windows NT machine with a physical memory of 750 MBs, and the server becomes unresponsive till a restart.

We are using iPlanet version 4.1. Shall we suspect memory leaks?

Any bit of help is appreciated.

Thanks in advance...
20 years ago
Hi,

As far as i understand, a method cannot be declared both abstract and private; because if it is declared private, then it can not be implemented in a subclass.

Please consider the following code snippet :



This compiles cleanly and prints A.D.m1() as expected.

Since a static nested class can access even private methods of the enclosing class, what is the point of forbidding, in this situation, to declare method m1() to be both private and abstract?

Thanks in advance...
20 years ago
Hi,

The following page clarifies the situation, i think :

JAC_061: Do Not Return From Inside A try Block (High)

Also, jdk1.4 javac compiler should issue a warning in such a situation.

...Savas...
[ May 27, 2004: Message edited by: savas karabuz ]
Hi again,

It's definitely a classpath issue, you can put jRegistryKey.jar in jre\lib\ext folder under your java home directory (C:\j2sdk1.4.2_04\jre\lib\ext on my machine, for example), jRegistryKey.dll can be put anywhere on Windows'PATH (system32 folder is OK). Here is a sample program i have tried and seen working which i copied from jRegistryKey Users Manual.

import ca.beq.util.win32.registry.*;
import java.util.*;

public class AccessRegistry {
public static void main(String[] args) {
RegistryKey r = new RegistryKey(RootKey.HKEY_CURRENT_USER, "Software");
if(r.hasSubkeys()) {
Iterator i = r.subkeys();
while(i.hasNext()) {
RegistryKey x = (RegistryKey)i.next();
System.out.println(x.toString());
} // while
} // if
}
}

Hope this helps...
20 years ago
Hi,

AFAIK there is no standart Java API to access Windows registry. You can develop your own JNI wrappers, or use available open-source implementations.

You can go through the following web page :

jRegistry Key

Hope this helps...
[ May 26, 2004: Message edited by: savas karabuz ]
20 years ago
Hi,

Since i couldn't dare coding in jdk1.1.6, i have implemented a very basic task scheduler in C.

Thanks all for your replies...
20 years ago
Hi all,

I need to schedule a task for repeated execution on a Solaris 7.5 machine with jdk1.1.6.

How can i implement a solution without Timer and TimerTask classes that are available only since jdk1.3?

Thanks...
20 years ago
Hi,
You can go through the following link :
http://java.sun.com/j2se/1.4.2/docs/guide/jps/index.html
Hope this helps...
...karabuz...
20 years ago
Yes, in my locale decimal point is a comma.
When the user inputs 12345.467 for example, i just want 12345.46, i want the inputed number truncated with two digits left after decimal point; not rounded. The default behavior with setMaximumFractionDigits() (in java.text.NumberFormat) method rounds every value ==> For Example, with the above number inputed, i.e., 12345.467 , the text field displays 12345.47 if you call setMaximumFractionDigits(2).
I am posting the code i use, if you wish to see...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/*
* Created on 05.May.2004
*/
/**
* @author Barış AKSU
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
import java.awt.GridLayout;
import java.text.NumberFormat;
import java.text.ParseException;
import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.text.MaskFormatter;
public class FormatEx1 extends JPanel {
private JFormattedTextField field1;
private JFormattedTextField field2;
public FormatEx1() {
super(new GridLayout(2, 2));
setUpField1();
setUpField2();
displayFields();
}
private void displayFields() {
add(new JLabel("field 1:"));
add(field1);
add(new JLabel("field 2:"));
add(field2);
}
private void setUpField1() {
NumberFormat format1;
format1 = NumberFormat.getInstance();
format1.setMinimumFractionDigits(2);
format1.setMaximumFractionDigits(2);
field1 = new JFormattedTextField(format1);

}
private void setUpField2() {
MaskFormatter format2;
try {
format2 = new MaskFormatter("(###) ###-####");
field2 = new JFormattedTextField(format2);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) {
JFrame frame = new JFrame("Number Format Demo");
frame.setDefaultCloseOperation
(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 200);
frame.getContentPane().add(new FormatEx1());
frame.setVisible(true);
}
}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^3
20 years ago
Hi everybody,
I have the following lines of code :

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
private JFormattedTextField field1;
...
NumberFormat format1 = NumberFormat.getInstance();
format1.setMinimumFractionDigits(2);
format1.setMaximumFractionDigits(2);
field1 = new JFormattedTextField(format1);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When the user inputs into this field, say 12345, it is converted to 12.345,00 after navigating to the next field(Locale specific). But if 12345,467 is inputed, it is converted to 12.345,47.
What i need, and don't know how to get, is just the "two" digits after the decimal point displayed on the screen, not the ones after the rounding occurs.
Alternatively, how can i create a MaskFormatter that accepts any number of digits 'before' the decimal point, but just two after it?
Any bit of help is appreciated...
Thanks in advance...
20 years ago
Thanks very much for your valuable response. Unfortunately, in Turkey it is a little bit hard to find those talented IBM professionals who could shed light on problems. As a matter of fact, after walking through the rare documentation on web for a hint, we have contacted with local IBM guys in Istanbul, and requested information on IBM's CICS Transaction Gateway product.
Since Java supports sockets programs on IP networks, we need a tool kit that allows us to write LU6.2 programs in Java. As far as i understand, a kind of Java/CPI-C API will do the work.
Can you please provide further hints on the subject? Are we on the right path? We are looking forward to hearing from you soon.
Billions of thanks for your contributions...
baksukara@yahoo.com