What do people use class loading for?

前端 未结 18 1499
暗喜
暗喜 2021-02-02 14:26

So, every Java text book talks about how flexible Java is since it can load classes at run time. Just cobble together a string and give it to Class.forName(), and

18条回答
  •  星月不相逢
    2021-02-02 15:16

    See the support for Oracle LOB handling in Spring Framework for example. Only because the framework offers specific support for Oracle you probably don't want to deploy an Oracle datasource as dependency for your e.g. MySQL projects. Therefore you load the Oracle drivers reflectively in the scope of an instance of the LOB handler.

提交回复
热议问题