Tiberiu Paun

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

Recent posts by Tiberiu Paun

I believe those are in standard documentation of jdk1.4, and it is written there that the package is since 1.4 .
If you are forced to use java 1.3 , you could download xerces parser from Apache foundation, and put the xerces jar in the classpath.
U have there also the interfaces u need
Rmi
U can send anything that implements Serializble, as input param, or as output in RMI.
While String class implements Serializable, yes, u can send a String .
The whole thing is that when u send a request, from the socket u get an ObjectOutputStream, and an ObjectInputStream. U can readObject() and writeObject on that socket, throught those streams, only if the object send and received can be serializable. Otherwise, it will throw a NotSerializableException
If you posted this at EJB forum, then I won't tell u about inheritance.
U may wish to do this kind of design when u want to return something from an ejb server, but u may don't know what u will return.
For example, lets say that u have your response from server as an array of classes requestvo (u have no ideea how big the array is, so u have to use array).
in these requestvo classes, some of them might have something different one from the other (lets say u do a select, and according to a customer_type, u make a difference in the result, for example the class requestvo should have additional fields in it, but there is no point of putting those fields in it, while not all the classes in the response should have it , even could have nothing in common but the only field inherited from mother class).
To be more specific: u want to return in an array customer's address, customer's children, etc, and, according to customer type (government, corporation, etc), u may wish to add additional_inform class if customer_type=corporation, which is different from the one of a government.
The only easy way is to do this design:
response would be : requestvo[]
class address extends requestvo
class additional_inform_corporate extends requestvo //information about category of corporation, how many employess, etc
class additional_inform_private extends requestvo //information about how many children, his address, marital status
In this way, the input parameter of the method would be the customer_id, no matter what type of customer it is, while u would have to do a retrieve, to see the customer type, which would not be desirable. Then u could see with "instanceof", or getClass(), what type of class that is, and invoke the proper methods on it.
In other "beautiful minds" (I've seen it at Amdocs), the return type of a method is Response and ResponseException (why did they need J2EE for, cause this looks something like CORBA?).
Hope I didn't misslead u in any way.
I'm sorry, but what u r trying there is not cool.
First, the String "" should be declared final somewhere, and not instantiate it everytime.
Secondly, if u want to not be dependant of how many fields must be there, I would say u should take this approach:
final String empty="";
....
Component[] comps=YourFrame.getComponents();
for(int i=0;i<comps.length;i++){
if(comps instanceof TextField //or whatever class TextMessage, whatever u use){
TextField field=(TextField)comps;
if(field.getText().equals(empty)){//whatever want u to do}
}
}
The array of the TextFields u put in the frame can be set when u add them to the Frame.
Hope that answers to your question
21 years ago
I believe the easiest way to do it is to put a filter, or something like that, on the outputstream.
I believe a trim (or a replace('\n',''), I believe) should do the trick very easy.
Indeed, this is not too good in terms performance, so u should look at that oracle tool of yours. JAD decompiler might be the best ideea, if that tool is not too big ???
I would say a good start for u would be to run the examples from the link above. The finece will come later, when things won't work the way u wanted to.
U may find some usefull information at jGuru, too.
I'm sorry to inform u that Oracle doesn't support more than 20-from what I know users simultanuously. It's not oracle's fault, but oracle driver's fault.
I know I made a JDBCConnection pool for oracle, and when I configured it for 20 users, it thrown me an exception with this topic.
However, u should use anything else but MS server. Try MySQL, is better.
We have a lot of applications, all of them do heavy selects in Oracle databases, none with the slightest problem.
The only application which uses MS SQL server has problems. And the database of it has only one table!!!
So if you use MS, than u r in trouble ...
If you say that all your classes have been compiled successfully in the same time, let me know if I am right:
U have a packge, lets call it mypack, where u have those classes.
U execute the command java mypack.MainClass, or simply MainClass, if u don't have it in the package.
Please look to see if u have any of the classes from the package in the current directory (where u execute java command), while java will look for classes in the . (if it is first in classpath), and then in jars or directories.
If u do have any classes named as the ones from the package in the directory mentioned above, just remove them, and try again.
Best regards, Tibi.
21 years ago
Hi.
Please excuse my poor knowledge, in case u already tried what I will suggest.
1. A thread can die suddenly most probably because there was a RuntimeException (NullPointerException, NumberFormatException, etc) inside run() method.
I would suggest you to write this :
public void run(){
try{
//business logic
}catch(Throwable t){
Log.log(log_trace,t.toString());
}
}
Hope this might help u.
2. On the other hand, from my poor knowledge, ThreadGroup class is not worth it.
When you use threadgroup , u start threads. starting a thread is pretty much slower than having the threads in a pool. U use ThreadGroup because probably u are interested in knowing when all those threads have stopped, and u'll have to do a loop (with sleep in it) to see how many active threads are inside this ThreadGroup. You can put this very easy (with a lot of code, of course) with a pool of threads, and would be a lot more faster (because of the pool and because when all those threads have finished a cycle in run -in run u have an endless loop, from which u can exist only when u want- u'll get a notify).
Hope u got what I said here, and, again, please excuse my poor knowledge in case I misslead u in any way.
Best regards, Tibi.
Best regards, Tibi.
Hi.
I don't really got what u asked, and please excuse my poor knowledge and skip this post, in case it's not u were looking for.
An example of JMS usage might be this: supposing u have 2 applications, one sends requests to the the other. If these requests are "getters", than u should use Java sesssion Beans, because u need that answer answer (get a customer address).
But if these requests are "updates" or "creates" (change customer's address), than u are not interested in the response of the second application, because if they fail, a system administrator can look at those fails, see why they failed, and resubmit them in some cases.
That would imply, of course, to have an error queue (or topic), but that's different topic.
These 2 applications might not have anything in common, so that's why you may not be interested if a flow failed or not. Maybe the second application is down for some time (but it will start again), but the first application might have no ideea about this, and you may not be able to change not even a line of code in these applications.
If you put a JMS server between those 2 applications, then your problems might be solved.
about an example of JMS, I would suggest u, from my poor knowledge, to use the examples from the example directory of your JMS server, because there are differences (it happened to me from Sun's J2EE server, different versions, as well as between Weblogic different versions).
Best regards, Tibi