0 votes
1 view
in SQL by (22.4k points)

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.


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);

Please log in or register to answer this question.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 4, 2019 in SQL by Tech4ever (22.4k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !