select * from tj23 where vin='"+rand.nextInt(1000000)+"' order by inday desc limit 10
50并发:
Thread[Thread-28,5,main]===>Mon Nov 08 14:24:50 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-07-26
Thread[Thread-28,5,main]===>Mon Nov 08 14:24:50 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-07-25
Thread[Thread-28,5,main]===>Mon Nov 08 14:24:50 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-07-24
Thread[Thread-14,5,main]===>Mon Nov 08 14:24:51 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-08-02
Thread[Thread-14,5,main]===>Mon Nov 08 14:24:51 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-08-01
Thread[Thread-14,5,main]===>Mon Nov 08 14:24:51 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-07-31
Thread[Thread-14,5,main]===>Mon Nov 08 14:24:51 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-07-30
Thread[Thread-14,5,main]===>Mon Nov 08 14:24:51 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-07-29
Thread[Thread-14,5,main]===>Mon Nov 08 14:24:51 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-07-28
Thread[Thread-14,5,main]===>Mon Nov 08 14:24:51 CST 2021-----Mon Nov 08 14:24:52 CST 2021----2024-07-27
100并发:
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-08-02
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-08-01
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-07-31
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-07-30
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-07-29
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-07-28
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-07-27
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-07-26
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-07-25
Thread[Thread-1,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:42 CST 2021----2024-07-24
Thread[Thread-7,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:43 CST 2021----2024-08-02
Thread[Thread-7,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:43 CST 2021----2024-08-01
Thread[Thread-7,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:43 CST 2021----2024-07-31
Thread[Thread-7,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:43 CST 2021----2024-07-30
Thread[Thread-7,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:43 CST 2021----2024-07-29
Thread[Thread-7,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:43 CST 2021----2024-07-28
Thread[Thread-7,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:43 CST 2021----2024-07-27
Thread[Thread-7,5,main]===>Mon Nov 08 14:26:41 CST 2021-----Mon Nov 08 14:26:43 CST 2021----2024-07-26
100并发会报资源不足的错误:
java.sql.SQLSyntaxErrorException: Reach limit of connections at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:828) at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:448) at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241) at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at org.doris.Yace7$Com.<init>(Yace7.java:41) at org.doris.Yace7.main(Yace7.java:18) 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.CommandLineWrapper.main(CommandLineWrapper.java:66) java.lang.NullPointerException at org.doris.Yace7$Com.run(Yace7.java:99) at java.lang.Thread.run(Thread.java:748) Exception in thread "Thread-96" java.lang.NullPointerException at org.doris.Yace7$Com.run(Yace7.java:109) at java.lang.Thread.run(Thread.java:748) java.sql.SQLSyntaxErrorException: Reach limit of connections at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:828) at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:448) at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241) at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at org.doris.Yace7$Com.<init>(Yace7.java:41) at org.doris.Yace7.main(Yace7.java:18) 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.CommandLineWrapper.main(CommandLineWrapper.java:66) java.lang.NullPointerException at org.doris.Yace7$Com.run(Yace7.java:99) at java.lang.Thread.run(Thread.java:748) Exception in thread "Thread-97" java.lang.NullPointerException at org.doris.Yace7$Com.run(Yace7.java:109) at java.lang.Thread.run(Thread.java:748)