N
N
new_year20212021-01-09 15:07:40
PostgreSQL
new_year2021, 2021-01-09 15:07:40

I want to remember the data from my android application into a Postgresql table, but it gives an error, what's the matter?

I want to connect to my database located on the heroku server .. But in the application, the android gives an error, like there is no driver, And the question is: how to add this driver to the android application along with the code.
Here is the documentation where I found out that this can be done, but in android studio, when I right-click on the project, I do not find the property item.

try{
            Connection conn=DriverManager.getConnection("jdbc:postgresql://ete-1.amazonaws.com/dfr",
                    "zfoiasyjulanza","e089d28af90");
            Statement st=conn.createStatement();
            String GPS = "12";
            Statement statement = null;

            statement = conn.createStatement();

            String SQL = "INSERT INTO gps_coordinat" + "(class) " + "VALUES" + "(" +  location.getLatitude() + ")";
            System.out.println("УСПЕХ");
            statement.executeUpdate(SQL);
            tvLocationGPS.setText("УСПЕХ");

        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-01-09
Hasanly @azerphoenix

Let me tell you this is a bad idea.
you don't need to directly access the db from android.
To do this, they write a backend (Rest service) and access the database through api

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question