Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2017
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. import groovy.sql.Sql
  2. def sql = Sql.newInstance("jdbc:mysql://localhost", "root","password", "com.mysql.jdbc.Driver")
  3. def y= "select * from table"
  4. table(sql,y)
  5. def table(sql,x){
  6. println ("$x")
  7. sql.execute("$x")
  8. }
  9.  
  10. 'select * from table'
  11. Sep 02, 2017 3:49:39 PM groovy.sql.Sql$AbstractQueryCommand execute
  12. WARNING: Failed to execute: ? because: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''select * from table'' at line 1
  13. Caught: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''select * from table'' at line 1
  14. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''select * from table'' at line 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement