daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest May 23rd, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void conectarMySQL(String host, String porta, String banco, String usuario, String senha){
  2. try{
  3. Class.forName("com.mysql.jdbc.Driver").newInstance();
  4. } catch(Exception erro){
  5. Log.e("MYSQL","Erro: "+erro);
  6. }
  7.  
  8.     try{
  9.         conn=DriverManager.getConnection("jdbc:mysql://"+host+":"+porta+"/"+banco+"?connectTimeout=9000&socketTimeout=9000&autoReconnect=true&secondsBeforeRetryMaster=3",usuario,senha);
  10.         Log.i("MYSQL", "Conectado.");
  11.     } catch(Exception erro){
  12.         Log.e("MYSQL","Erro: "+erro);
  13.     }
  14. }
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