users@glassfish.java.net

Re: load Class on runtime?

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Sun, 16 Sep 2012 06:02:48 +0530

Use getClass().loadClass() if you know the class belongs to the same
loader as the current class, else use
Thread.currentThread().getContextClassLoader().loadClass().

Sahoo
On Sunday 16 September 2012 01:34 AM, forums_at_java.net wrote:
> how ist the right syntax to load a class on runtime on a glasfish. public
> static final String SQLSERVER = "mundus.entity.MSSqlAdapter";
> adapterClass =
> adapterLoader.loadClass(getClassName(classid)); does'nt find the
> class. thx
> Olaf
>
> --
>
> [Message sent by forum member 'ostwdd']
>
> View Post: http://forums.java.net/node/890265
>
>