Skip to content

Commit e7a411f

Browse files
committed
test: make id as param
1 parent f8d0398 commit e7a411f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/java/org/chdb/jdbc/ChdbConnectionTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.chdb.jdbc;
22

3-
import org.junit.jupiter.api.*;
3+
import org.junit.jupiter.api.AutoClose;
4+
import org.junit.jupiter.api.BeforeAll;
5+
import org.junit.jupiter.api.Test;
46

57
import java.sql.*;
68

@@ -27,9 +29,10 @@ public void testStatement() throws SQLException {
2729

2830
@Test
2931
public void testPreparedStatement() throws SQLException {
30-
String sql = "select * from file('src/test/resources/logs.csv','CSV') where level = ? and id > 0";
32+
String sql = "select * from file('src/test/resources/logs.csv','CSV') where level = ? and id > ?";
3133
ChdbPreparedStatement statement = (ChdbPreparedStatement) conn.prepareStatement(sql);
3234
statement.setString(1, "error");
35+
statement.setInt(2, 0);
3336
System.out.println(statement.getRealSQL());
3437
ResultSet resultSet = statement.executeQuery();
3538
while (resultSet.next()) {

0 commit comments

Comments
 (0)