我使用此代码用数据库中的数据填充我的 jtable:
String sql = "SELECT "
+ "a.pranesimo_pav AS 'Pavadinimas', a.sukurimo_data AS 'Sukurtas' , b.gavimo_data AS 'Gavimo data'"
+ "FROM Pranesimas a "
+ "INNER JOIN "
+ "( "
+ "SELECT pranesimo_id, gavimo_data "
+ "FROM Pranesimo_siuntimas_vienam_zmogui "
+ "WHERE vardas_pavarde = '" +vardas_pavarde+ "' "
+ "UNION ALL "
+ "SELECT pranesimo_id, gavimo_data "
+ "FROM Pranesimo_siuntimas_grupei "
+ "WHERE grupes_pav = '" +grupes_pav+ "'"
+ ")b ON a.pranesimo_id = b.pranesimo_id ";
pst = conn.prepareStatement(sql);
rs = pst.executeQuery(sql);
antraspanelesamipranesimaiTable.setModel(DbUtils.resultSetToTableModel(rs));
}
它完成了这项工作,但在我的“日期时间”值的末尾,它在它的末尾添加了“.0”,例如:
数据库中的值 - '2013-01-20 02:50:00' 我在表中得到的值 - '2013-01-20 02:50:00.0'
我怎样才能解决这个问题?