Created
February 7, 2016 21:49
-
-
Save murphysean/ce9c05581084ce78fb9f to your computer and use it in GitHub Desktop.
Testing SQL UTF-8 4 byte emoji
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GrabConfig( systemClassLoader=true ) | |
@Grab( 'mysql:mysql-connector-java:5.1.38' ) | |
import groovy.sql.Sql | |
class GroovySqlExample1{ | |
static void main(String[] args) { | |
def sql = Sql.newInstance("jdbc:mysql://domovm.local.domo.com:3306/", "user","pass", "com.mysql.jdbc.Driver") | |
sql.eachRow("SHOW VARIABLES WHERE Variable_name LIKE 'character\\_set\\_%' OR Variable_name LIKE 'collation%';"){ row -> | |
println row.variable_name + " " + row.value | |
} | |
sql.execute "INSERT domo_dev.buzz_search (message_id, content) VALUES (8, '🖐') ON DUPLICATE KEY UPDATE content='🖐';" | |
sql.eachRow("SELECT content FROM domo_dev.buzz_search WHERE message_id=8;"){row-> | |
println row.content | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment