package beans.com.opentour;
import java.io.*;
import java.sql.*;

public class ConnectionBean {
	private String driver, sql, url;
	private ResultSet rs;
	private Statement stmt;

		public ConnectionBean() {
			this.sql = "select * from associados where tipo = 'associado'";
			this.driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
			this.url = "jdbc:microsoft:sqlserver://srvninho01:1433;DatabaseName=Opentour";
		try {
				Class.forName(driver);
				Connection con = DriverManager.getConnection(url, "Open", "ninho");
				Statement stmt = con.createStatement();
			}
			catch (SQLException e) {
				
			}
			catch (ClassNotFoundException e) {
							
			}
		}

		public ResultSet executeQuery(String sql) throws SQLException {
				return stmt.executeQuery(sql);
		}

		public int executeUpdate(String sql) throws SQLException {
				return stmt.executeUpdate(sql);
		}

}
