A
A
Alik_Kolizeev2021-01-09 15:56:00
Java
Alik_Kolizeev, 2021-01-09 15:56:00

Why writes No suitable driver?

I just want to connect to the database through my android application, so the database is naturally located on the server
, here is the build.grable screen

5ff9a7c6a8c06559721542.png

try{
            Connection conn=DriverManager.getConnection("jdbc:postgresql://ec2-34-m/df4rc37mr",
                    "lanza","5f9e089d28af90");
            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("УСПЕХ");

        }
        catch (Exception e){
            System.out.print(e);
            tvLocationGPS.setText(e.getMessage());

But for some reason everything gives the error No suitable driver

Answer the question

In order to leave comments, you need to log in

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

Hello colleague!
If I'm not mistaken, then this is almost the 5th account from which you ask the same questions. One of your accounts has already been blocked by the administration.
My recommendations for you to learn the basics of programming, OOP, the basics of Java development, apparently, were also ignored.
Don't get me wrong, you should first learn the basics of programming, and then get into android development.
By the way, here are all your accounts from which you SPAM QnA.
https://qna.habr.com/user/Alik_Kolizeev
https://qna.habr.com/user/Java_Python
https://qna.habr.com/user/xxxfdd
https://qna.habr.com/user /new_year2021
https://qna.habr.com/user/timyr_murmur
Here. same questions from different accounts:
Why writes No suitable driver?

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

What is the error?
String SQL = "INSERT INTO gps_coordinat (class)" + (GPS );

I want to remember the data from my android application into a Postgresql table, but it gives an error, what's the matter?
String SQL = "INSERT INTO gps_coordinat" + "(class) " + "VALUES" + "(" +  location.getLatitude() + ")";

I strongly recommend that you learn to google and read information in Russian or English before contacting the service and asking such simple monotonous questions over and over again
I can’t display an error in my adnrod application why?
catch (Exception e){
            System.out.print(e);
            tvLocationGPS.setText(e);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question