0

It's possible get name of current table, on implementation of RowMapper. I try by metadata, but not have sucess

Vikash Pandey
  • 5,407
  • 6
  • 41
  • 42
Thiago
  • 13
  • 5

1 Answers1

0

You can try to determine the tablename by

 ResultSet.getMetaData().getTableName(int column)

As both ResultSet and ResultSetMetaData are only interfaces, the implementation depends on the database driver your are using.

So, if this method does not deliver the tablename:

  • the driver implementation does not support it.
  • the column does not have a table associated with (e.g. select sysdate ...)

For example current oracle db driver does not support it.

For H2, check http://www.h2database.com/html/features.html , it describes the behaviour of getTableName() depending on the selected Compatibility Mode.

Rainer Montag
  • 493
  • 1
  • 6
  • 13