Код: Выделить всё
import java.util.Scanner;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.sql.ResultSet;
public class Driver {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Connection c = null;
try {
System.out.println("Before connection"); //This is getting printed
c = DriverManager.getConnection("jdbc:postgresql://localhost:53574/","postgres","**");
System.out.println("After connection"); //This is not getting printed
}
catch(Exception e) {
e.printStackTrace();
}
}
}
Код: Выделить всё
Connection to localhost:5357 refusedПожалуйста, помогите мне понять, какую ошибку я совершаю. Заранее спасибо.
Подробнее здесь: https://stackoverflow.com/questions/731 ... l-via-jdbc
Мобильная версия