Tutorial by Examples

Inside of your {CATALINA_HOME}/conf/ folder exists a server.xml and context.xml file. Each one of these contains similar code, but references different parts of Tomcat to complete the same task. server.xml is server-wide configuration. This is where you can set up HTTPS, HTTP2, JNDI Resources, etc....
public void test() { Connection conn = null; Statement stmt = null; try { Context ctx = (Context) new InitialContext().lookup("java:comp/env"); conn = ((DataSource) ctx.lookup("jdbc/SomeDataSource")).getConnection(); stmt = conn.createS...

Page 1 of 1