Monthly Archives: October 2013

Using an embedded SQL database in Java web application

You have a Java web application needing a relational SQL database. According to JavaEE conventions, you declare the DataSource in web.xml: <resource-ref> <res-ref-name>jdbc/DS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> and then fetch it in code with (DataSource)new InitialContext().lookup(“java:comp/env/jdbc/DS”). Using Maven, Jetty and HSQLDB, … Continue reading

Posted in Java, JavaEE, web | 3 Comments