This commit is contained in:
2024-08-07 09:16:27 -04:00
parent fdfadd5c7e
commit 5f971cf684
5200 changed files with 731717 additions and 0 deletions

53
proto/HistoricRS.java Normal file
View File

@@ -0,0 +1,53 @@
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
{
<classname> <instancename> = new <classname>
connection=getConnection();
statement=connection.createStatement();
list=new ArrayList();
strQuery="select jdjdjd djdjdjd djdjdjd from <tablename>";
rs=statement.executeQuery(strQuery);
while(rs.next())
{
<assign variables>
list.add(<instancename>);
}
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);
}
}