Azure SQL Android Studio AssertionError: Nummsgsrcvd: 1 должен быть меньше, чем Nummsgssent: 1JAVA

Программисты JAVA общаются здесь
Anonymous
Azure SQL Android Studio AssertionError: Nummsgsrcvd: 1 должен быть меньше, чем Nummsgssent: 1

Сообщение Anonymous »

Я пытаюсь подключиться к моей базе данных SQL Azure через Android Studio, но продолжаю получать утверждение при запуске приложения. Я использую mssql-jdbc-1212.10.1.jre11 < /p>
server.java
public static void Connect1() throws SQLException {
ResultSet resultSet = null;
try {
System.out.println("Connecting to the database");
Connection connection = DriverManager.getConnection(properties.getProperty("url"), properties);
System.out.println("Database connection test: " + connection.getCatalog());

System.out.println("Closing database connection");
connection.close();
}
catch(SQLException e){
e.printStackTrace();
System.out.println("Connection failed");
} catch (NetworkOnMainThreadException e){
e.printStackTrace();
System.out.println("Connection failed");
}catch (AssertionError e){
e.printStackTrace();
System.out.println("Connection failed");
}

}
< /code>
Я могу подключиться к базе данных через Apache Netbeans, используя один и тот же код подключения и библиотеку JDBC, поэтому все мои переменные подключения верны. Я также искал по всему Интернету решения, но не могу найти ни одного, который работает.2025-07-03 19:36:32.627 19153-19175 System.err com.example.azuretestjdbc W java.lang.AssertionError: n u m M s g s R c v d : 1 s h o u l d b e l e s s t h a n n u m M s g s S e n t : 1 < b r / > 2 0 2 5 - 0 7 - 0 3 1 9 : 3 6 : 3 2 . 6 2 7 1 9 1 5 3 - 1 9 1 7 5 S y s t e m .err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:6814)
2025-07-03 19:36:32.627 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.TDSReader.nextPacket(IOBuffer.java:6778)
2025-07-03 19:36:32.627 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.TDSReader.ensurePayload(IOBuffer.java:6750)
2025-07-03 19:36:32.629 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.TDSReader.readBytes(IOBuffer.java:7068)
2025-07-03 19:36:32.630 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readInternal(IOBuffer.java:945)
2025-07-03 19:36:32.632 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(IOBuffer.java:935)
2025-07-03 19:36:32.632 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal(IOBuffer.java:1197)
2025-07-03 19:36:32.633 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffer.java:1183)
2025-07-03 19:36:32.633 19153-19175 System.err com.example.azuretestjdbc W at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readFromSocket(ConscryptEngineSocket.java:983)
2025-07-03 19:36:32.633 19153-19175 System.err com.example.azuretestjdbc W at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:947)
2025-07-03 19:36:32.633 19153-19175 System.err com.example.azuretestjdbc W at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.-$$Nest$mprocessDataFromSocket(Unknown Source:0)
2025-07-03 19:36:32.636 19153-19175 System.err com.example.azuretestjdbc W at com.android.org.conscrypt.ConscryptEngineSocket.doHandshake(ConscryptEngineSocket.java:236)
2025-07-03 19:36:32.638 19153-19175 System.err com.example.azuretestjdbc W at com.android.org.conscrypt.ConscryptEngineSocket.startHandshake(ConscryptEngineSocket.java:218)
2025-07-03 19:36:32.639 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1843)
2025-07-03 19:36:32.639 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3552)
2025-07-03 19:36:32.639 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:3172)
2025-07-03 19:36:32.640 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:3014)
2025-07-03 19:36:32.640 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1836)
2025-07-03 19:36:32.640 19153-19175 System.err com.example.azuretestjdbc W at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1246)
2025-07-03 19:36:32.643 19153-19175 System.err com.example.azuretestjdbc W at java.sql.DriverManager.getConnection(DriverManager.java:580)
2025-07-03 19:36:32.645 19153-19175 System.err com.example.azuretestjdbc W at java.sql.DriverManager.getConnection(DriverManager.java:190)
2025-07-03 19:36:32.646 19153-19175 System.err com.example.azuretestjdbc W at com.example.azuretestjdbc.Server.Connect1(Server.java:58)
2025-07-03 19:36:32.646 19153-19175 System.err com.example.azuretestjdbc W at com.example.azuretestjdbc.MainActivity$2.run(MainActivity.java:67)
2025-07-03 19:36:32.646 19153-19175 System.err com.example.azuretestjdbc W at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2025-07-03 19:36:32.646 19153-19175 System.err com.example.azuretestjdbc W at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
2025-07-03 19:36:32.646 19153-19175 System.err com.example.azuretestjdbc W at java.lang.Thread.run(Thread.java:1012)


Подробнее здесь: https://stackoverflow.com/questions/796 ... than-numms

Вернуться в «JAVA»