package com.ganesh.learn.teeid; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class MultisourceModel { public static void main(String... args) throws ClassNotFoundException, SQLException { String url = "jdbc:teiid:Employee@mm://localhost:31000"; String sql = "select * from Emp.emp where Emp.SOURCE_NAME=?"; Class.forName("org.teiid.jdbc.TeiidDriver"); Connection connection = null; try { connection = DriverManager.getConnection(url, "user", "user"); PreparedStatement statement = connection.prepareStatement(sql); statement.setString(1, "office"); //Statement statement = connection.createStatement(); ResultSet results = statement.executeQuery(); while (results.next()) { System.out.print(results.getString(1)); System.out.println(" "+results.getString(2)); } results.close(); statement.close(); } catch (SQLException e) { e.printStackTrace(); throw e; } finally { try { connection.close(); } catch (SQLException e1) { // ignore } } } }