class Database implements VariableSpace, LoggingObjectInterface {

  public RowMetaInterface getQueryFieldsFromPreparedStatement( String sql ) throws Exception {
    PreparedStatement preparedStatement = null;
    try {
      preparedStatement =
          connection.prepareStatement( databaseMeta.stripCR( sql ), ResultSet.TYPE_FORWARD_ONLY,
              ResultSet.CONCUR_READ_ONLY );
      preparedStatement.setMaxRows( 1 );
      ResultSetMetaData rsmd = preparedStatement.getMetaData();
      return getRowInfo( rsmd, false, false );
    } catch ( Exception e ) {
      throw new Exception( e );
    } finally {
      if ( preparedStatement != null ) {
        try {
          preparedStatement.close();
        } catch ( SQLException e ) {
          throw new KettleDatabaseException( "Unable to close prepared statement after determining SQL layout", e );
        }
      }
    }
  }

  @Deprecated public  Database( DatabaseMeta databaseMeta );
  public  Database( LoggingObjectInterface parentObject, DatabaseMeta databaseMeta );

}