import java.sql.*;

public class DBConnect
{
	public Connection connection;

	public Connection MySQLConnect(String DBName)
	{
		try
		{
			Class.forName("org.gjt.mm.mysql.Driver").newInstance();
		}
		catch (Exception E)
		{
			System.err.println("Unable to load driver.");
			E.printStackTrace();
		}


		try
		{
			connection = DriverManager.getConnection(
			  "jdbc:mysql://192.168.1.1:3306/"+DBName+"?user=root&password=1234");
		}
		catch (SQLException E)
		{
			System.out.println("SQLException: " + E.getMessage());
			System.out.println("SQLState:     " + E.getSQLState());
			System.out.println("VendorError:  " + E.getErrorCode());
		}
		return connection;
	}

	public Connection IBConnect(String DBName)
	{
		try
		{
			Class.forName("interbase.interclient.Driver");
   			String url = "jdbc:interbase://localhost//"+DBName;
   			connection =    DriverManager.getConnection(url, "SYSDBA","masterkey");
		}
   		catch( Exception ex )
   		{
      		System.out.println("ERRO: "+ex);
		}
		return connection;
	}


}

