I've got a situation building a data analysis tool where my users can write SQL query (including joins, calculations, etc) and I need to be provide options to the user based on the data types of the columns in the result. I'm us开发者_如何学Going JDBC to connect to Postgres. Is there any way to get Postgres to report the data type of a computed column?
With JDBC, you should be able to call .getMetaData() in your ResultSet, and iterate through the columns and e.g. learn their types with .getColumnType()
精彩评论