DuckDBResultSet

com.softinio.duck4s.algebra.DuckDBResultSet
case class DuckDBResultSet(underlying: ResultSet, statement: Statement) extends AutoCloseable

A wrapper around a JDBC ResultSet that provides automatic resource management for both the result set and its associated statement.

This class is designed to be used with the using pattern or explicit resource management to ensure that both the underlying ResultSet and its Statement are properly closed when no longer needed. The class exports common ResultSet methods for convenient access.

Value parameters

statement

the Statement that created this ResultSet, needed for proper cleanup

underlying

the underlying JDBC ResultSet

Attributes

See also

DuckDBConnection for creating result sets

DuckDBPreparedStatement for parameterized queries

Since

0.1.0

Example
 import scala.util.Using
// Automatic resource management val result =
Using(connection.executeQuery("SELECT * FROM users")) { rs => while
(rs.next()) { println(s"Name: ${rs.getString("name")}, Age:
${rs.getInt("age")}") } }
// Or with explicit management val rs = connection.executeQuery("SELECT
count(*) FROM users") try { if (rs.next()) { val count = rs.getInt(1)
println(s"Total users: $count") } } finally { rs.close() // Closes both
ResultSet and Statement } 
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def close(): Unit

Closes both the underlying ResultSet and its associated Statement.

Closes both the underlying ResultSet and its associated Statement.

This method ensures proper cleanup of database resources. It's important to call this method when done with the result set, either explicitly or through a resource management pattern like Using.

Attributes

Since

0.1.0

Example
 val rs = connection.executeQuery("SELECT * FROM users") try { //
 Process results... } finally { rs.close() // Always close resources }

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product