- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用 MS JDBC 驱动程序连接到 Azure SQL:
import java.sql.*;
public class ExampleSQLJDBC {
public static void main(String[] args) {
// Setting.
String connectionUrl = "jdbc:sqlserver://SERVER.database.windows.net:1433;database=DATABASE;encrypt=true;trustServerCertificate=true;";
String user = "USER@SERVER";
String pass = "PASSWORD";
// Declare the JDBC object.
Connection conn = null;
try {
// Establish the connection.
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
conn = DriverManager.getConnection(connectionUrl, user, pass);
}
catch (Exception e) {
e.printStackTrace();
}
}
}
但我得到:
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Broken pipe ClientConnectionId:742ba7b5-43bb-441b-8e8d-bbb9dc5fa8ce".
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2226)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1756)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1803)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1454)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1285)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1131)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at run.ExampleSQLJDBC.main(ExampleSQLJDBC.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
有趣的是,我可以从同一台计算机上使用 Navicat 连接到数据库。因此,问题不应该出在防火墙的设置上。
元数据:
如何从 Java 连接到 Azure SQL?
编辑:
如果我在 OS X 上使用 javac
1.8.0_92 编译彼得潘的代码,并在 OS X 上使用 java
1.8.0_92 执行字节码,则该错误不会消失。
编辑 2:当我使用 -Djavax.net.debug=ssl:handshake:verbose
调试 SSL 连接详细信息时:
trigger seeding of SecureRandom
done seeding SecureRandom
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for TLSv1.1
%% No cached client session
*** ClientHello, TLSv1.2
RandomCookie: GMT: 1466081162 bytes = { 238, 135, 254, 162, 132, 164, 75, 240, 96, 107, 17, 103, 60, 109, 229, 149, 31, 110, 218, 87, 49, 29, 121, 114, 115, 6, 44, 32 }
Session ID: {}
Cipher Suites: [TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
Compression Methods: { 0 }
Extension elliptic_curves, curve names: {secp256r1, sect163k1, sect163r2, secp192r1, secp224r1, sect233k1, sect233r1, sect283k1, sect283r1, secp384r1, sect409k1, sect409r1, secp521r1, sect571k1, sect571r1, secp160k1, secp160r1, secp160r2, sect163r1, secp192k1, sect193r1, sect193r2, secp224k1, sect239k1, secp256k1}
Extension ec_point_formats, formats: [uncompressed]
Extension signature_algorithms, signature_algorithms: SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA, SHA256withECDSA, SHA256withRSA, SHA224withECDSA, SHA224withRSA, SHA1withECDSA, SHA1withRSA, SHA1withDSA
Extension server_name, server_name: [type=host_name (0), value=hlt3qa7607.database.windows.net]
***
main, WRITE: TLSv1.2 Handshake, length = 233
main, called close()
main, called closeInternal(true)
main, SEND TLSv1.2 ALERT: warning, description = close_notify
main, WRITE: TLSv1.2 Alert, length = 2
main, called closeSocket(true)
main, waiting for close_notify or alert: state 5
main, received EOFException: ignored
main, called closeInternal(false)
main, close invoked again; state = 5
main, handling exception: java.io.IOException: SQL Server did not return a response. The connection has been closed. ClientConnectionId:1eb03958-1566-4844-b842-e020f0c36121
main, called closeSocket()
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server did not return a response. The connection has been closed. ClientConnectionId:1eb03958-1566-4844-b842-e020f0c36121"....
编辑3:设置驱动程序记录全部后:
Jun 17, 2016 9:26:37 AM com.microsoft.sqlserver.jdbc.SQLServerDriver:1 connect
FINER: ENTRY Arguments not traced.
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:serverName Value:hlt3qa7607.database.windows.net
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:portNumber Value:1433
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:databaseName Value:DATABASE
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:encrypt Value:true
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:trustServerCertificate Value:true
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection <init>
FINE: ConnectionID:1 created by (SQLServerDriver:1)
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection login
FINER: ConnectionID:1 Start time: 1466148398058 Time out time: 1466148413058 Timeout Unit Interval: 1200
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection login
FINE: ConnectionID:1 This attempt server name: hlt3qa7607.database.windows.net port: 1433 InstanceName: null useParallel: false
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection login
FINE: ConnectionID:1 This attempt endtime: 1466148399258
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection login
FINE: ConnectionID:1 This attempt No: 0
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection connectHelper
FINE: ConnectionID:1 Connecting with server: hlt3qa7607.database.windows.net port: 1433 Timeout slice: 1194 Timeout Full: 15
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.TDSChannel open
FINER: TDSChannel (ConnectionID:1): Opening TCP socket...
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
FINER: ConnectionID:1 ClientConnectionId: 1a3032c8-493d-4f99-8641-d0f02211d82c Requesting encryption level:ON
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
FINER: ConnectionID:1 ClientConnectionId: 1a3032c8-493d-4f99-8641-d0f02211d82c ActivityId 866c0053-25be-4eb2-90c7-a40b5b0535a4-1
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.TDSChannel logPacket
FINEST: /192.168.1.186:63328 SPID:0 ConnectionID:1 ClientConnectionId: 1a3032c8-493d-4f99-8641-d0f02211d82c Prelogin request ...
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.TDSChannel logPacket
FINEST: /192.168.1.186:63328 SPID:0 ConnectionID:1 ClientConnectionId: 1a3032c8-493d-4f99-8641-d0f02211d82c Prelogin response
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
FINE: ConnectionID:1 ClientConnectionId: 1a3032c8-493d-4f99-8641-d0f02211d82c Server returned major version:12
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
FINER: ConnectionID:1 ClientConnectionId: 1a3032c8-493d-4f99-8641-d0f02211d82c Negotiated encryption level:ON
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
FINER: ConnectionID:1 ClientConnectionId: 1a3032c8-493d-4f99-8641-d0f02211d82c Ignoring prelogin response option:5
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINER: TDSChannel (ConnectionID:1) Enabling SSL...
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINER: TDSChannel (ConnectionID:1) SSL handshake will trust any certificate
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINEST: TDSChannel (ConnectionID:1) Getting TLS or better SSL context
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINEST: TDSChannel (ConnectionID:1) Initializing SSL context
Jun 17, 2016 9:26:38 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINEST: TDSChannel (ConnectionID:1) Creating SSL socket
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxySocket getInputStream
FINEST: TDSChannel (ConnectionID:1) (ProxySocket): Getting input stream
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxySocket getOutputStream
FINEST: TDSChannel (ConnectionID:1) (ProxySocket): Getting output stream
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINER: TDSChannel (ConnectionID:1) Starting SSL handshake
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream writeInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@13c78c0b Writing 238 bytes
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream writeInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Starting new TDS packet...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSWriter writeBytes
FINEST: TDSWriter@41629346 (ConnectionID:1) Writing 8 bytes
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream writeInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Writing 238 bytes...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSWriter writeBytes
FINEST: TDSWriter@41629346 (ConnectionID:1) Writing 238 bytes
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream flush
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@13c78c0b Flushing
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream flush
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Ignored a request to flush the stream
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@12843fce Reading 5 bytes
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream readInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): Reading 5 bytes...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream ensureSSLPayload
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): No handshake response bytes available. Flushing SSL handshake output stream.
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream endMessage
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Finishing TDS message
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSWriter endMessage
FINEST: TDSWriter@41629346 (ConnectionID:1) Finishing TDS message
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel logPacket
FINEST: /0:0:0:0:0:0:c0a8:1ba:63328 SPID:0 TDSWriter@41629346 (ConnectionID:1) sending packet (246 bytes)
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel write
FINER: TDSChannel (ConnectionID:1) write failed:Broken pipe
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerException logException
FINE: *** SQLException:ConnectionID:1 ClientConnectionId: 1a3032c8-493d-4f99-8641-d0f02211d82c com.microsoft.sqlserver.jdbc.SQLServerException: Broken pipe ClientConnectionId:1a3032c8-493d-4f99-8641-d0f02211d82c Broken pipe ClientConnectionId:1a3032c8-493d-4f99-8641-d0f02211d82c
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerException logException
FINE: com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2226)com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2210)com.microsoft.sqlserver.jdbc.TDSChannel.write(IOBuffer.java:1894)com.microsoft.sqlserver.jdbc.TDSWriter.flush(IOBuffer.java:4285)com.microsoft.sqlserver.jdbc.TDSWriter.writePacket(IOBuffer.java:4186)com.microsoft.sqlserver.jdbc.TDSWriter.endMessage(IOBuffer.java:3192)com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream.endMessage(IOBuffer.java:824)com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.ensureSSLPayload(IOBuffer.java:687)com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readInternal(IOBuffer.java:762)com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(IOBuffer.java:754)com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal(IOBuffer.java:949)com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffer.java:937)sun.security.ssl.InputRecord.readFully(InputRecord.java:465)sun.security.ssl.InputRecord.read(InputRecord.java:503)sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1682)com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1803)com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1454)com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1285)com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1131)java.sql.DriverManager.getConnection(DriverManager.java:664)java.sql.DriverManager.getConnection(DriverManager.java:247)ExampleSQLJDBC.main(ExampleSQLJDBC.java:44)
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerConnection:1 close
FINER: ENTRY
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel disableSSL
FINER: TDSChannel (ConnectionID:1) Disabling SSL...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel disableSSL
FINEST: TDSChannel (ConnectionID:1) Rewiring proxy streams for SSL socket close
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel disableSSL
FINER: TDSChannel (ConnectionID:1) Closing SSL socket
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream writeInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@13c78c0b Writing 7 bytes
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream flush
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@13c78c0b Flushing
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@12843fce Reading 5 bytes
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@12843fce Read -1 bytes
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel disableSSL
FINER: TDSChannel (ConnectionID:1) SSL disabled
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINEST: TDSChannel (ConnectionID:1): Closing inputStream...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINEST: TDSChannel (ConnectionID:1): Closing outputStream...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINER: TDSChannel (ConnectionID:1): Closing TCP socket...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerConnection:1 close
FINER: RETURN
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream ensureSSLPayload
FINER: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): Ending TDS message threw exception:Broken pipe ClientConnectionId:1a3032c8-493d-4f99-8641-d0f02211d82c
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINER: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@12843fce Broken pipe ClientConnectionId:1a3032c8-493d-4f99-8641-d0f02211d82c
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINER: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@12843fce Reading bytes threw exception:Broken pipe ClientConnectionId:1a3032c8-493d-4f99-8641-d0f02211d82c
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxySocket close
FINER: TDSChannel (ConnectionID:1) (ProxySocket): Ignoring close
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINER: Broken pipe ClientConnectionId:1a3032c8-493d-4f99-8641-d0f02211d82c
java.io.IOException: Broken pipe ClientConnectionId:1a3032c8-493d-4f99-8641-d0f02211d82c
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.ensureSSLPayload(IOBuffer.java:692)
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readInternal(IOBuffer.java:762)
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(IOBuffer.java:754)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal(IOBuffer.java:949)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffer.java:937)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1682)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1803)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1454)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1285)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1131)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at ExampleSQLJDBC.main(ExampleSQLJDBC.java:44)
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINER: java.security path: /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/security
Security providers: [SUN version 1.8, SunRsaSign version 1.8, SunEC version 1.8, SunJSSE version 1.8, SunJCE version 1.8, SunJGSS version 1.8, SunSASL version 1.8, XMLDSig version 1.8, SunPCSC version 1.8, Apple version 1.8]
SSLContext provider info: Sun JSSE provider(PKCS12, SunX509/PKIX key/trust factories, SSLv3/TLSv1/TLSv1.1/TLSv1.2)
SSLContext provider services:
[SunJSSE: KeyFactory.RSA -> sun.security.rsa.RSAKeyFactory
aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
, SunJSSE: KeyPairGenerator.RSA -> sun.security.rsa.RSAKeyPairGenerator
aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
, SunJSSE: Signature.MD2withRSA -> sun.security.rsa.RSASignature$MD2withRSA
aliases: [1.2.840.113549.1.1.2, OID.1.2.840.113549.1.1.2]
, SunJSSE: Signature.MD5withRSA -> sun.security.rsa.RSASignature$MD5withRSA
aliases: [1.2.840.113549.1.1.4, OID.1.2.840.113549.1.1.4]
, SunJSSE: Signature.SHA1withRSA -> sun.security.rsa.RSASignature$SHA1withRSA
aliases: [1.2.840.113549.1.1.5, OID.1.2.840.113549.1.1.5, 1.3.14.3.2.29, OID.1.3.14.3.2.29]
, SunJSSE: Signature.MD5andSHA1withRSA -> sun.security.ssl.RSASignature
, SunJSSE: KeyManagerFactory.SunX509 -> sun.security.ssl.KeyManagerFactoryImpl$SunX509
, SunJSSE: KeyManagerFactory.NewSunX509 -> sun.security.ssl.KeyManagerFactoryImpl$X509
aliases: [PKIX]
, SunJSSE: TrustManagerFactory.SunX509 -> sun.security.ssl.TrustManagerFactoryImpl$SimpleFactory
, SunJSSE: TrustManagerFactory.PKIX -> sun.security.ssl.TrustManagerFactoryImpl$PKIXFactory
aliases: [SunPKIX, X509, X.509]
, SunJSSE: SSLContext.TLSv1 -> sun.security.ssl.SSLContextImpl$TLS10Context
aliases: [SSLv3]
, SunJSSE: SSLContext.TLSv1.1 -> sun.security.ssl.SSLContextImpl$TLS11Context
, SunJSSE: SSLContext.TLSv1.2 -> sun.security.ssl.SSLContextImpl$TLS12Context
, SunJSSE: SSLContext.TLS -> sun.security.ssl.SSLContextImpl$TLSContext
aliases: [SSL]
, SunJSSE: SSLContext.Default -> sun.security.ssl.SSLContextImpl$DefaultSSLContext
, SunJSSE: KeyStore.PKCS12 -> sun.security.pkcs12.PKCS12KeyStore
]
java.ext.dirs: /Users/jan/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerException logException
FINE: *** SQLException:ConnectionID:1 ClientConnectionId: 1a3032c8-493d-4f99-8641-d0f02211d82c com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Broken pipe ClientConnectionId:1a3032c8-493d-4f99-8641-d0f02211d82c". The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Broken pipe ClientConnectionId:1a3032c8-493d-4f99-8641-d0f02211d82c".
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerException logException
FINE: com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2226)com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1756)com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1803)com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1454)com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1285)com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1131)java.sql.DriverManager.getConnection(DriverManager.java:664)java.sql.DriverManager.getConnection(DriverManager.java:247)ExampleSQLJDBC.main(ExampleSQLJDBC.java:44)
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerConnection:1 close
FINER: ENTRY
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINEST: TDSChannel (ConnectionID:1): Closing inputStream...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINEST: TDSChannel (ConnectionID:1): Closing outputStream...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINER: TDSChannel (ConnectionID:1): Closing TCP socket...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerConnection:1 close
FINER: RETURN
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerConnection:1 close
FINER: ENTRY
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINEST: TDSChannel (ConnectionID:1): Closing inputStream...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINEST: TDSChannel (ConnectionID:1): Closing outputStream...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINER: TDSChannel (ConnectionID:1): Closing TCP socket...
Jun 17, 2016 9:26:43 AM com.microsoft.sqlserver.jdbc.SQLServerConnection:1 close
FINER: RETURN
最佳答案
通过以下步骤解决了问题:
scutil --get HostName
(区分大小写!)sudo scutil --set HostName "newname"
来源:https://youtrack.jetbrains.com/issue/JRE-221#comment=27-1826316
关于java - 如何使用 JDBC 连接到 Azure SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37743819/
我正在编写一个具有以下签名的 Java 方法。 void Logger(Method method, Object[] args); 如果一个方法(例如 ABC() )调用此方法 Logger,它应该
我是 Java 新手。 我的问题是我的 Java 程序找不到我试图用作的图像文件一个 JButton。 (目前这段代码什么也没做,因为我只是得到了想要的外观第一的)。这是我的主课 代码: packag
好的,今天我在接受采访,我已经编写 Java 代码多年了。采访中说“Java 垃圾收集是一个棘手的问题,我有几个 friend 一直在努力弄清楚。你在这方面做得怎么样?”。她是想骗我吗?还是我的一生都
我的 friend 给了我一个谜语让我解开。它是这样的: There are 100 people. Each one of them, in his turn, does the following
如果我将使用 Java 5 代码的应用程序编译成字节码,生成的 .class 文件是否能够在 Java 1.4 下运行? 如果后者可以工作并且我正在尝试在我的 Java 1.4 应用程序中使用 Jav
有关于why Java doesn't support unsigned types的问题以及一些关于处理无符号类型的问题。我做了一些搜索,似乎 Scala 也不支持无符号数据类型。限制是Java和S
我只是想知道在一个 java 版本中生成的字节码是否可以在其他 java 版本上运行 最佳答案 通常,字节码无需修改即可在 较新 版本的 Java 上运行。它不会在旧版本上运行,除非您使用特殊参数 (
我有一个关于在命令提示符下执行 java 程序的基本问题。 在某些机器上我们需要指定 -cp 。 (类路径)同时执行java程序 (test为java文件名与.class文件存在于同一目录下) jav
我已经阅读 StackOverflow 有一段时间了,现在我才鼓起勇气提出问题。我今年 20 岁,目前在我的家乡(罗马尼亚克卢日-纳波卡)就读 IT 大学。足以介绍:D。 基本上,我有一家提供簿记应用
我有 public JSONObject parseXML(String xml) { JSONObject jsonObject = XML.toJSONObject(xml); r
我已经在 Java 中实现了带有动态类型的简单解释语言。不幸的是我遇到了以下问题。测试时如下代码: def main() { def ks = Map[[1, 2]].keySet()
一直提示输入 1 到 10 的数字 - 结果应将 st、rd、th 和 nd 添加到数字中。编写一个程序,提示用户输入 1 到 10 之间的任意整数,然后以序数形式显示该整数并附加后缀。 public
我有这个 DownloadFile.java 并按预期下载该文件: import java.io.*; import java.net.URL; public class DownloadFile {
我想在 GUI 上添加延迟。我放置了 2 个 for 循环,然后重新绘制了一个标签,但这 2 个 for 循环一个接一个地执行,并且标签被重新绘制到最后一个。 我能做什么? for(int i=0;
我正在对对象 Student 的列表项进行一些测试,但是我更喜欢在 java 类对象中创建硬编码列表,然后从那里提取数据,而不是连接到数据库并在结果集中选择记录。然而,自从我这样做以来已经很长时间了,
我知道对象创建分为三个部分: 声明 实例化 初始化 classA{} classB extends classA{} classA obj = new classB(1,1); 实例化 它必须使用
我有兴趣使用 GPRS 构建车辆跟踪系统。但是,我有一些问题要问以前做过此操作的人: GPRS 是最好的技术吗?人们意识到任何问题吗? 我计划使用 Java/Java EE - 有更好的技术吗? 如果
我可以通过递归方法反转数组,例如:数组={1,2,3,4,5} 数组结果={5,4,3,2,1}但我的结果是相同的数组,我不知道为什么,请帮助我。 public class Recursion { p
有这样的标准方式吗? 包括 Java源代码-测试代码- Ant 或 Maven联合单元持续集成(可能是巡航控制)ClearCase 版本控制工具部署到应用服务器 最后我希望有一个自动构建和集成环境。
我什至不知道这是否可能,我非常怀疑它是否可能,但如果可以,您能告诉我怎么做吗?我只是想知道如何从打印机打印一些文本。 有什么想法吗? 最佳答案 这里有更简单的事情。 import javax.swin
我是一名优秀的程序员,十分优秀!