package zbi.risk.server.vhi.mapped public class HistoricDA { public List readAll()throws SQLException { Statement statement=null; ResultSet rs=null; Connection connection=null; String strQuery=null; List list=null; try { = new connection=getConnection(); statement=connection.createStatement(); list=new ArrayList(); strQuery="select jdjdjd djdjdjd djdjdjd from "; rs=statement.executeQuery(strQuery); while(rs.next()) { list.add(); } return list; } finally { if(null!=rs)rs.close(); if(null!=statement)statement.close(); } } }; private Connection getConnection()throws SQLException { try { InitialContext jndiCntx=new InitialContext(); DataSource ds=(DataSource)jndiCntx.lookup("java:MailDb"); jndiCntx.close(); return ds.getConnection(); } catch(NamingException exception) { message("[MailEJB::getConnection] Object not found"); throw new EJBException(exception); } }