Here you can find the source of tableRecommendationExistsHsqdb(DataSource dataSource)
private static boolean tableRecommendationExistsHsqdb(DataSource dataSource)
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.sql.DataSource; public class Main { private static boolean tableRecommendationExistsHsqdb(DataSource dataSource) { try (Connection connection = dataSource.getConnection()) { PreparedStatement stmt = connection.prepareStatement( "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.SYSTEM_TABLES WHERE TABLE_NAME = ?"); stmt.setString(1, "RECOMMENDATION"); ResultSet rs = stmt.executeQuery(); if (rs.next()) { return rs.getString(1) != null; } else return false; } catch (SQLException e) { throw new RuntimeException(e); }/* w w w . java 2 s . c o m*/ } }