Skip to content

Commit 49b460a

Browse files
committed
remove jndi/database support
1 parent 259fd00 commit 49b460a

1 file changed

Lines changed: 35 additions & 35 deletions

File tree

src/test/java/org/htmlunit/util/quercus/servlet/QuercusServlet.java

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
import java.util.logging.Level;
4040
import java.util.logging.Logger;
4141

42-
import javax.naming.Context;
43-
import javax.naming.InitialContext;
44-
import javax.naming.NamingException;
45-
import javax.sql.DataSource;
42+
//import javax.naming.Context;
43+
//import javax.naming.InitialContext;
44+
//import javax.naming.NamingException;
45+
// import javax.sql.DataSource;
4646

4747
import com.caucho.config.ConfigException;
4848
import com.caucho.quercus.QuercusContext;
@@ -423,9 +423,9 @@ protected void setInitParam(String paramName, String paramValue)
423423
if ("compile".equals(paramName)) {
424424
setCompile(paramValue);
425425
}
426-
else if ("database".equals(paramName)) {
427-
setJndiDatabase(paramValue);
428-
}
426+
// else if ("database".equals(paramName)) {
427+
// setJndiDatabase(paramValue);
428+
// }
429429
else if ("ini-file".equals(paramName)) {
430430
setIniFile(paramValue);
431431
}
@@ -468,34 +468,34 @@ else if ("license-directory".equals(paramName)) {
468468
}
469469
}
470470

471-
private void setJndiDatabase(String value)
472-
throws ServletException
473-
{
474-
try {
475-
Context ic = new InitialContext();
476-
DataSource ds;
477-
478-
if (! value.startsWith("java:comp")) {
479-
try {
480-
ds = (DataSource) ic.lookup("java:comp/env/" + value);
481-
}
482-
catch (Exception e) {
483-
// for glassfish
484-
ds = (DataSource) ic.lookup(value);
485-
}
486-
}
487-
else {
488-
ds = (DataSource) ic.lookup(value);
489-
}
490-
491-
if (ds == null)
492-
throw new ServletException(L.l("database '{0}' is not valid", value));
493-
494-
// setDatabase(new QuercusDataSource(ds, null, null, false));
495-
} catch (NamingException e) {
496-
throw new ServletException(e);
497-
}
498-
}
471+
// private void setJndiDatabase(String value)
472+
// throws ServletException
473+
// {
474+
// try {
475+
// Context ic = new InitialContext();
476+
// DataSource ds;
477+
//
478+
// if (! value.startsWith("java:comp")) {
479+
// try {
480+
// ds = (DataSource) ic.lookup("java:comp/env/" + value);
481+
// }
482+
// catch (Exception e) {
483+
// // for glassfish
484+
// ds = (DataSource) ic.lookup(value);
485+
// }
486+
// }
487+
// else {
488+
// ds = (DataSource) ic.lookup(value);
489+
// }
490+
//
491+
// if (ds == null)
492+
// throw new ServletException(L.l("database '{0}' is not valid", value));
493+
//
494+
// // setDatabase(new QuercusDataSource(ds, null, null, false));
495+
// } catch (NamingException e) {
496+
// throw new ServletException(e);
497+
// }
498+
// }
499499

500500
private void initImpl(ServletConfig config)
501501
throws ServletException

0 commit comments

Comments
 (0)