Advertisement
Guest User

Untitled

a guest
Feb 15th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. public class MainActivity extends AppCompatActivity {
  2. private static final String url ="jdbc:mysql://localhost:3306/mydbtest?characterEncoding=UTF-8&useSSL=false";
  3. private static final String username ="root";
  4. private static final String password ="root";
  5. public Connection connection;
  6. final String LOG_TAG = "myLogs";
  7. Potok mPotok =new Potok();
  8.  
  9. @Override
  10. protected void onCreate(Bundle savedInstanceState) {
  11. super.onCreate(savedInstanceState);
  12. setContentView(R.layout.main);
  13. mPotok.run();
  14. }
  15. private class Potok implements Runnable{
  16. public void run(){
  17. try{
  18. connection = DriverManager.getConnection(url,username,password);
  19. Log.d(LOG_TAG, "Vse ok potok idet ");
  20. }catch (Exception e){
  21. Log.d(LOG_TAG, "Oshibka potoka ");
  22. e.printStackTrace();
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement