Pre Exam Test Practice
Ask a Question
Advertise on boostr.in
Organizational Research By
Surprising Reserch Topic
multiple queries executed in java in single statement
multiple queries executed in java in single statement ¬†using -'java,mysql,sql'
Hi I was wondering if it is possible to execute something like this using JDBC as it currently provides an exception even though it is possible in the MySQL query browser.
"SELECT FROM * TABLE;INSERT INTO TABLE;"
While I do realize that it is possible with having the SQL query string being split and the statement executed twice but I was wondering if there is a one time approach for this.
¬†¬†¬†¬†String url = "jdbc:mysql://localhost:3306/";
¬†¬†¬†¬†String dbName = "databaseinjection";
¬†¬†¬†¬†String driver = "com.mysql.jdbc.Driver";
¬†¬†¬†¬†String sqlUsername = "root";
¬†¬†¬†¬†String sqlPassword = "abc";
¬†¬†¬†¬†connection = DriverManager.getConnection(url+dbName, sqlUsername, sqlPassword);
Sep 21, 2015
to add a comment.
Related Hot Questions
Government Jobs Opening