package com.mjm.solarInsertDB;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * Created by user on 2016/12/19.
 */
public class MySQL {
    ConnectInformation connectInformation;
    private StringBuffer url = new StringBuffer();

    private Connection con;

    public MySQL(ConnectInformation connectInformation) {

        this.connectInformation = connectInformation;

    }


    public void insertSQLCommand(String command) throws SQLException {

        connectInformation.checkConnection();

        Statement stmt;


        stmt = connectInformation.getConnection().createStatement();

        stmt.execute(command);

        stmt.close();

        connectInformation.getConnection().close();


    }


}
