Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Connection string for connecting Android(java) app to MariaDB

    • 0
    • 1
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 2.57k
    Comment on it

    Here is the simple connection string to connect the android with Maria DB on linux. you need to have MariaDB configured to the default port:3306

    try
    {
      Class.forName("org.mariadb.jdbc.Driver");  
      Connection cntn = DriverManager.getConnection("jdbc:mariadb://localhost:3306/projectName", "root", "");  
      Statement stmt = cntn.createStatement(); 
      String Value1="qwerty",Value2="keywords";
      stmt.executeUpdate("insert into TABLE values('"+Value1+"','"+Value2+"')");
    }
    

 1 Comment(s)

  • I tried this and it shoots an error with StandardCharset in the connection line. With minimum api 19 (kitkat) this works but my app has to run on older android versions. Is there any solution with api level 18 or lower? With library are you using?

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: