SHARE
TWEET

Untitled

a guest Dec 13th, 2016 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. val url = "jdbc:mysql://XXX-XX-XXX-XX-XX.compute-1.amazonaws.com:3306/pg_partner"
  2. val driver = "com.mysql.jdbc.Driver"
  3. val username = "XXX"
  4. val password = "XXX"
  5. var connection:Connection = DriverManager.getConnection(url, username, password)
  6. val statement = connection.createStatement()
  7. val patnerName = statement.executeQuery("SELECT id,name FROM partner")
  8.    
  9. while (patnerName.next) {
  10.   val id = patnerName.getString("id")
  11.   val name = patnerName.getString("name")
  12.   println("id = %s, name = %s".format(id,name))
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top