Answer the question
In order to leave comments, you need to log in
I want to display data from a postgre sql table, but what's wrong?
I just want to display the id column from the users_id table like this
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("select id from users_id");
while(rs.next()){
System.out.println(rs.getString("contry_id")+", "+rs.getString("country_name"));
Answer the question
In order to leave comments, you need to log in
As far as I remember from your previous question, you are connecting to the postgres database ( jdbc:postgresql://localhost:5432/postgres - the last member here means the name of the database), but you need to Drive_in.
jdbc:postgresql://localhost:5432/Drive_in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question