2

Is possible and how Store Java Classes in DB and then Load class from DB and call loaded Class with some arguments?

İsmail C.
  • 23
  • 4

1 Answers1

0

You can use the Java Compiler API to compile it at runtime. See here for an example

In order to load classes at runtime, you can either use an URLClassLoader if you can specify the location of the bytecode with a URL, or use ClassLoader.defineClass and supply the bytecode as an array of bytes.

Make sure that your class is known at compile time and you can do it with the help of interface.

Vishwa Ratna
  • 5,567
  • 5
  • 33
  • 55