java · jdbc · mysql

SqlExecuter vs JDBC

public class CmdExec {

	public static void main(String argv[]) {
	           executeSql();
	  
	}
	private static void executeSql() {
	    final class SqlExecuter extends SQLExec {
	        public SqlExecuter() {
	            Project project = new Project();
	            project.init();
	            setProject(project);
	           // setTaskType("sql");
	            setTaskName("sql");
	        }
	    }

	    SqlExecuter executer = new SqlExecuter();
	    executer.setSrc(new File("/home/admin/Obama/scripfile.sql"));
	    executer.setDriver("com.mysql.jdbc.Driver");
	    executer.setPassword("root");
	    executer.setUserid("root");
	    executer.setUrl("jdbc:mysql://localhost:3306/Central_Share");
	    executer.execute();
	}
	
	}
//add dependency 
 <dependency>
        <groupId>izpack</groupId>
        <artifactId>izpack-standalone-compiler</artifactId>
        <version>3.7.2</version>
      </dependency>
Advertisements