-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
183144f
commit 9de1e8c
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
databend-jdbc/src/test/java/com/databend/jdbc/TestTempTable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.databend.jdbc; | ||
|
||
import org.junit.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import java.sql.Connection; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.sql.Statement; | ||
|
||
public class TestTempTable { | ||
|
||
@Test | ||
public void testTempTable() throws SQLException { | ||
try(Connection c1 = Utils.createConnection()) { | ||
Statement statement= c1.createStatement(); | ||
statement.execute("create or replace temp table table1(i int)"); | ||
statement.execute("insert into table1 values (1), (2)"); | ||
statement.executeQuery("select * from table1"); | ||
ResultSet rs = statement.getResultSet(); | ||
Assert.assertEquals(true, rs.next()); | ||
Assert.assertEquals(1, rs.getInt(1)); | ||
Assert.assertEquals(true, rs.next()); | ||
Assert.assertEquals(2, rs.getInt(1)); | ||
Assert.assertEquals(false, rs.next()); | ||
} | ||
} | ||
} |