简体   繁体   中英

Android app connectivity to remote database in Derby

I am trying to connect an android app to a derby database on a pc to get data form that. For this i googled a database specially for this purpose ie Awake SQL . I tried the following code for the connection to the derby database. The code is of a function which is called on the button click of the android app.

public void getData(View view)
{
    new Thread()
    {
        public void run()
        {
            String url = "jdbc:derby://localhost:1527"; 

            String username = "user"; 
            char [] password = {'p', 'a', 's', 's', 'w', 'o', 'r', 'd', '1'};


            try
            {
            Connection connection  
            = new AwakeConnection(url, username, password); 

            }
            catch(Exception e)
            {
                System.out.println(e);
            }
        }
    }.start();

}

Actually this code was given in the user guide of Awake SQL. When i run the above code i get the debugging mode of the eclipse. I cant get any error in the console. I am not sure if i am doing it right or not. I am still unable to connect the database for the android app.

http://www.awake-sql.org/上,我没有看到Derby被列为受支持的数据库

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM