daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Jun 5th, 2017 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  public void setConnection(){
  2.         String hostName = "tcp:hex.database.windows.net,1433";
  3.         String dbName = "Hex";
  4.         String user = "rootadmin";
  5.         String password = "Mleko123";
  6.         String url = String.format("jdbc:sqlserver://%s.database.windows.net:1433;database=%s;user=%s;password=%s;encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;", hostName, dbName, user, password);
  7.         Connection connection = null;
  8.  
  9.         try {
  10.             connection = DriverManager.getConnection(url);
  11.             Log.d("MyApp","Connection successfull!");
  12.         } catch (Exception e) {
  13.             e.printStackTrace();
  14.         }
  15.     }
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