mirror of
https://github.com/CarmJos/EasySQL.git
synced 2026-06-04 15:28:20 +08:00
test(query): 添加SuppressWarnings标识
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package cc.carm.lib.easysql.tests;
|
||||
|
||||
import cc.carm.lib.easysql.api.SQLManager;
|
||||
import cc.carm.lib.easysql.api.SQLQuery;
|
||||
import cc.carm.lib.easysql.TestHandler;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
public class QueryNotCloseTest extends TestHandler {
|
||||
|
||||
@Override
|
||||
public void onTest(SQLManager sqlManager) throws SQLException {
|
||||
SQLQuery query = sqlManager.createQuery()
|
||||
.inTable("test_user_table")
|
||||
.orderBy("id", false)
|
||||
.setLimit(5)
|
||||
.build().execute();
|
||||
|
||||
ResultSet resultSet = query.getResultSet();
|
||||
|
||||
while (resultSet.next()) {
|
||||
|
||||
System.out.printf("id: %d username: %s%n", resultSet.getInt("id"), resultSet.getString("username"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user