* @return a string representing the nanosecond value.
*/
private String getNanos(Timestamp ts) throws SQLException
{
ISQLDatabaseMetaData md = _session.getMetaData();
HibernateDialect dialect = DialectFactory.getDialect(md);
boolean dialectSupportsSubSecondTimestamps = getTimestampFlag();
if (!dialectSupportsSubSecondTimestamps
|| dialect.getTimestampMaximumFractionalDigits() == 0) {
return "";
}
String result = "" + ts.getNanos();
int timestampMaximumFractionalDigits = dialect.getTimestampMaximumFractionalDigits();
if(result.length() >= timestampMaximumFractionalDigits)
{
result = result.substring(0, timestampMaximumFractionalDigits);
}
return result;