Tenho a seguinte Connection String em um programa funcional em C#(Visual Studio):
“Data Source=7D8AEC373AD2471\SQLEXPRESS;Initial Catalog=AMB;Integrated Security=True”
Utilizando o Driver JTDS (ou o da Microsoft se for melhor para responder), como ficaria?
Tentei algumas, mas sem sucesso:
Tentativa - JTDS
“jdbc:jtds:sqlserver://127.0.0.1:1433/7D8AEC373AD2471/SQLEXPRESS/AMB;namedPipes=true”
“jdbc:jtds:sqlserver://localhost:1433/7D8AEC373AD2471/SQLEXPRESS/AMB;namedPipes=true”
“jdbc:jtds:sqlserver://127.0.0.1:1433/7D8AEC373AD2471/SQLEXPRESS/AMB;”
“jdbc:jtds:sqlserver://127.0.0.1:1433/7D8AEC373AD2471/SQLEXPRESS;”
Tentativa - Microsoft
“jdbc:sqlserver://7D8AEC373AD2471/SQLEXPRESS;databaseName=AMB”
Obtendo em todas elas o seguinte erro:
Exception in thread "main" java.sql.SQLException: Network error IOException: Connection refused: connect
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:410)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Principal.main(Principal.java:14)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:307)
at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:257)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:311)
... 5 more
Alguma sugestão?