HI,
i have a simple class
Code:
package vo.as400;
public class CStagione implements java.io.Serializable {
private String cdc_stag;
private String dsc_stag;
public String _remoteClass = "vo.as400.CStagione";
public String getCdc_stag() {
return cdc_stag;
}
public void setDsc_stag(String dsc_stag) {
this.dsc_stag = dsc_stag;
}
public void setCdc_stag(String cdc_stag) {
this.cdc_stag = cdc_stag;
}
public String getDsc_stag() {
return dsc_stag;
}
}
and my dao class
Code:
public CStagione[] getAllSeason_ok() throws DaoException {
try
{
Connection conn=ConnectionFactory.getInstance().getConn();
Session session = FirebirdSession.currentSession();
PreparedStatement stmt = session.connection().prepareStatement("Select TRIM(CDELTB),SUBSTR(DATITB,1,30) from "arctb00f Where cdtbtb='STG' AND STRETB='' Order by 1 ");
ResultSet rset = stmt.executeQuery();
ArrayList list = new ArrayList();
CStagione season = null;
for (; rset.next(); list.add(season))
{
season = new CStagione();
season.setCdc_stag(rset.getString(1));
season.setDsc_stag(rset.getString(2));
}
rset.close();
stmt.close();
FirebirdSession.currentSession();
CStagione seasons[] = new CStagione[list.size()];
// conn.close();
list.toArray(seasons);
return seasons;
}
catch (Exception ex) {
ex.printStackTrace();
throw new java.lang.UnsupportedOperationException("CStagioneDao getAllSeason "+ex.getMessage());
}
}
It's possible to use hibernate for to get this result? can you help me with a mapping please
Devis