Android Question Help with RDC

Discussion in 'Android Questions' started by imgsimonebiliato, Apr 2, 2015.

  1. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    Hello,
    so I need to connect and doing some sql interrogation to my MySQL server.

    I follow this tutorial for to configure RDC, but when I try to access (with http://127.0.0.1:17178/?method=test) the server I get this error:

    Code:
    RemoteServer is running (Thu Apr 02 21:54:47 CEST 2015)
    java.sql.SQLException: An attempt by a client 
    to checkout a Connection has timed out.
    I copied to the jdbc_driver folder, a jar file named: "com.mysql.jdbc_5.1.5"
    And this is the config.properties file:


    Code:
    #Lines starting with '#' are comments.
    #Backslash character at the end of line means that the command continues in the next line.
    DriverClass=com.mysql.jdbc.Driver
    JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8
    User=db_user
    Password=my_password
    ServerPort=
    17178
    #If Debug is true then this file will be reloaded on every query.
    #This is useful if you need to modify the queries.
    Debug=true

    #commands
    sql.create_table=CREATE TABLE animals (\
         id INT NOT NULL AUTO_INCREMENT,\
         name CHAR(30) NOT NULL,\
         image BLOB,\
         PRIMARY KEY (id))
    sql.insert_animal=INSERT INTO animals VALUES (null, ?,?)
    sql.select_animal=SELECT name, image FROM animals WHERE name = ?

    Please, how can solve? I need to install "Connect/j"?
    How can I connect directly to my database?
    Is RDC necessary in my application? If yes, how can I import it?
     
    Last edited: Apr 2, 2015
  2. giga

    giga Well-Known Member Licensed User

    Is this database local? You also may want to ping the server and check your connection stability.
     
  3. Eumel

    Eumel Active Member Licensed User

    The file should be "mysql-connector-java-5.1.30-bin.jar"

    Get it from HERE

    --------------
    Eumel
     
  4. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    Hi, I followed the tutorial. I think that it si a general database for tests. Isn't it? In that case, what params I must modify to connect to my MySql remote database?


    Hi, your link if for version 5.1.35. Where I can find the correct jar file?
     
  5. Eumel

    Eumel Active Member Licensed User

    5.1.35 is also ok.

    The RDC Server and your MySQL Database Server should run on the same pc.

    -----
    Eumel
     
  6. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    My final intent is to execute queries from a remote database.
    If I use RDC is a good way right? So, please, what I have to change, to connect to my personal database?

    Please help
     
  7. Eumel

    Eumel Active Member Licensed User

    User=db_user
    Password=my_password

    Only this.
     
  8. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    If it's only this, I can't understand how to use
     
  9. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    And the
    JdbcUrl?
     
  10. Eumel

    Eumel Active Member Licensed User

    The jdbcUrl is localhost.

    As i said in post 5: RDC server and MySQL Database Server should run on same pc.
     
  11. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    That's ok.. Thanks
     
  12. giga

    giga Well-Known Member Licensed User

    "My final intent is to execute queries from a remote database". First make sure you can see it from the inside then check your port 17178 on the router to see if you can get it from the outside.

    This is correct locally:
    Code:
    DriverClass=com.mysql.jdbc.Driver
    JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8
    User=db_user
    Password=my_password
    ServerPort=
    17178
    Instead of localhost you could also try the actual IP example : 192.168.1.100
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice