Skip to main content

load Class on runtime?

1 reply [Last post]
ostwdd
Offline
Joined: 2012-09-15

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

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ss141213
Offline
Joined: 2005-03-30

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@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
>
>