Is it possible?

Hi .

I have a Problem.

I want to work wiht a class (using it's methods, seting attributes, . . . ). But the name of the class is not known in the time of compilation only in run-time.So, can I?

Is there a methode in Java for executing commands via string?

Because I can only save the name of the class and the coresponding methode into a value (in run-time) and compose a string.

For example:

How can I execute the following command? When I know all the necessary info only in run-time?

MyClass objMyClass = new MyClass();

objMyClass.setMyValue("xxx");

Is there a method like the one for getOQLQuery but for Classes?

Examlpe:

String strQry =" SELECT . . . ";

Oql = tx.getOQLQuery(strQry);

. . .

I have been searching on the internet and found something in

" java.lang.reflect.* " Field but did not understand how to use it.

Please help me if you can.

Thanks JohnyGee.

[979 byte] By [JohnyGeea] at [2007-10-2 5:34:53]
# 1
[url= http://java.sun.com/docs/books/tutorial/reflect/index.html]The Reflection API[/url]
MartinHilperta at 2007-7-16 1:45:33 > top of Java-index,Other Topics,Java Community Process (JCP) Program...
# 2
Thank you very much for the help.
JohnyGeea at 2007-7-16 1:45:33 > top of Java-index,Other Topics,Java Community Process (JCP) Program...