Get Database Connection from Web Application Server Data Source

zhaozj2021-02-16  42

Javax.naming.context initctX = new initialContext ();

Javax.naming.context envctx = (javax.naming.context) Initctx.lookup ("Java: Comp / ENV");

DataSource DS = (Datasource) Envctx.lookup ("JDBC /" DBNAME);

Return DS.GetConnection ();

转载请注明原文地址:https://www.9cbs.com/read-20460.html

New Post(0)