/*
 * This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public License
 *  as published by the Free Software Foundation.

 *  There is no copyright.

 *  MockwareTeam (C) 2009

 */

package core;

/**
 *
 * @author yetkin
 */
import java.sql.*;

public class DB
{
        public DB() {}

        public Connection dbConnect(String db_connect_string,
          String db_userid, String db_password)
        {
                try
                {
                        Class.forName("com.mysql.jdbc.Driver").newInstance();
                        Connection conn = DriverManager.getConnection(
                          db_connect_string, db_userid, db_password);

                        System.out.println("connected");
                        return conn;

                }
                catch (Exception e)
                {
                        e.printStackTrace();
                        return null;
                }
        }
        public Connection exdbConnect(String db_connect_string,
          String db_userid, String db_password)
        {
                try
                {
                        Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
                        Connection conn = DriverManager.getConnection(
                          db_connect_string, db_userid, db_password);

                        System.out.println("connected");
                        return conn;

                }
                catch (Exception e)
                {
                        e.printStackTrace();
                        return null;
                }
        }
};
