私が使用しているクエリがjdbcTemplateを使用して小文字で月を取得するには?
String sql=select trim(CdateTo) cdate,
count(case when Verified = 'WithGrant' then 1 end) as grant,
count(case when Verified = 'WithDiscount' then 1 end) as CC
from mse where Verified IN ('WithDiscount','WithGrant') and
CdateTo > SYSDATE - 9
GROUP BY trim(CdateTo)
ORDER BY TO_DATE(cdate,'DD/MM/YYYY')
と春jdbcTemplateコードであるが、これは私がそれは31のように私を返す必要がしたい31-MAY-16 のような日付を返す
try {
return jdbcTemplate.query(sql, new RowMapper<Trif>() {
@Override
public Trif mapRow(ResultSet rs, int rowNum) throws SQLException {
Trif trif = new Trif();
*************some code*******
Trif.setDate(rs.getString("cdate"));
***********someCode*********
return trif;
}
});
} catch (DataAccessException e) {
return null;
}
のようなものです月五月は首都での最初の手紙を示していて、他は小さいです。 これをどのように達成することができますか?
なぜ単純なString操作を管理しないのですか?ここには: 文字列smallLetters = rs.getString( "cdate"); –
アプリケーションをステートレスとスケールのままにできるJava側でこれを処理するだけです。 SimpleDateFormatクラスで簡単にこれを管理できます。 –