Howie Jiang

Greenhorn
+ Follow
since Aug 25, 2003
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 Howie Jiang

Hi, I have this query:

select x.a, y.b from table1 x join table2 y on x.id = y.id where y.type in ('xxx', 'xxxx', 'xxxxx') and x.c = 'something'

table x is very big, 30 million rows. y.id is the key of table y.

The execution of this query is a few second, but when I iterate through the resultset, it takes me 10 minutes. This is too long. There are 800000 records in the resultset.

If I do it in this way:
select x.a, y.b from table1 x join table2 y on x.id = y.id where y.type in ('xxx') and x.c = 'something'
UNION
select x.a, y.b from table1 x join table2 y on x.id = y.id where y.type in ('xxxx') and x.c = 'something'
UNION
select x.a, y.b from table1 x join table2 y on x.id = y.id where y.type in ('xxxxx') and x.c = 'something'

The exeuciton will take me 5 minutes, and iteration through the resultset is just 1 second.

Why like that?

And any way to minimize both statement execution time and resultset iteration time?

Thanks very much~~!!
Howie
hi experts,

I have some shared jars (some data models, etc) that will be used by several application modules. I am facing some choices:

1. package these shared jars inside the application moduels.
2. put in the shared library of Websphere application server.

Which way is better? What's the pros and cons?

If in future I need to support weblogic or other application servers, any impact?

I am considering version conflict issue if put in the shared library, how do you think of it?

Thanks,
JX
hi,

I want to process a jar file in a java program.

I use JarFile jf = new JarFile("abc.jar");

Then in order to find all the files with path "com/def/". How to do it?

Currently what I do is very tedious especially when the jar is big.
Enumeration en = jf.entries();
then process each element in enumeration and see whether it's belong to the path.

Is there any easier way that I can list all the files with same path?
14 years ago
I am trying to extract some files from a jar file using
jar xf xxx.jar

I have some problems here.

1) how can I extract all the files with ending .properties? I try "jar xf xxx.jar com/aaa/bbb/*.properties", but failed.

2) how can I avoid specify the full path? for example extract all the property files in any path.

Any one can help? Thanks very much
[ March 16, 2005: Message edited by: Howie Jiang ]
14 years ago
Hi, I have an XML file, eg.
<cd>
<name>a</name>
<name>b</name>
...
</cd>

my jsp page want to list all the cd names. Before each name, there will be a checkbox to let user select.

After select, user click save button, then modify the XML by adding an attribute to each <name> element to indicate whether selected.

How can I do this? My current thought is to parse the XML, and find out all the names first before come into this page. Then display all the names. After submit, modify the XML accordingly. Is there any other way to do it?

Thanks.
[ January 25, 2005: Message edited by: Howie Jiang ]
Thank you very much....

One more question is how can I just include the directory that including those jars in the classpath? currently i set classpath to all the jars.. so I am wondering whether any easy way that can just set classpath to the directory..
14 years ago
I download xerces jar files.how to setup my machine(Windows)to make it work?

Thanks
14 years ago
I am processing very big files.. I get out of memory exception when I process every 1000 records in the file.. but processing 100 records is okay. but procesing every 100 records is using longer time than processing every 10 records.. I get two questions here.

1. how can I know the memory will be used out and can do some detection before it throw me an exception?

2. Why my processing every 10 record at a time is faster? how can I get the best performance..

Thanks very much!
14 years ago
I need to process very big file..
If I use FileInputStream, how big can the file be?
If I want to split the file into smaller ones, how to do it?
If the file is at remote location, how can I get and process it using streaming technology?

Thanks very much!
14 years ago
What are OCTET String and IA5String? If I have binary data of them? How can I get the original readable data?

Thanks
14 years ago
How can I read a binary file and read byte by byte?

Thanks
14 years ago
Hi, how to secure RMI? eg. client, server authentication, message integration..etc.
14 years ago
on server side, how to know how many clients currently connected? and what are their IPs?

thanx
14 years ago
Hi, for dining philosopher problem, any good suggestions on how to implement it using RMI? The requirement is no communication btw clients, and no centralized controller..
I have figured out how to solve deadlock and starvation problem. But how to solve:
1. if a client take chopsticks and are eating, but lost connection for server.
2. chopstick sharing problem as in previous post.
3. efficiency. there won't be any philosopher eat too many times or someone eat too few times.

thanks for the help!!!
14 years ago
Hi, I am new to RMI. Have this question here.

If more than one client connect to the server, and call a method which will modify the same resouce, eg. an integer. How does RMI handle this kind of problem?

If the method being called by two client at the same time, will it be queued for excution?

I writing a test program as follows:

on Server:
int i; //initial value is 0
public int getI() {
int k = i;

//----- below is just simulating the program do sth else
int t = 0;
for (int g=0; g<1000; g++)
t=g;
//-------------------------

i++;
return k;
}

Each time client connect to server and call getI(), i will be increased by 1. At the client side, i will print the returned value. However, I found that if there are two clients, they will print a lot of same value.

How can I solve this kind of resouce share problem in RMI?

thanx
14 years ago