⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e304. getting a varray value from an oracle table.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
This example retrieves values contained in an Oracle VARRAY type. The example uses the table and array type created in e301 Creating a VARRAY Type in an Oracle Database. 
    try {
        // Create a statement
        Statement stmt = connection.createStatement();
    
        // Select rows from varray_table
        ResultSet resultSet = stmt.executeQuery("SELECT * FROM varray_table");
    
        // Get the VARRAY values from each row
        while (resultSet.next()) {
            // Get the VARRAY value in the first column
            oracle.sql.ARRAY array = ((oracle.jdbc.driver.OracleResultSet)resultSet).getARRAY(1);
    
            // Get the VARRAY elements; values.length is the number of values in the VARRAY
            java.math.BigDecimal[] values = (java.math.BigDecimal[])array.getArray();
        }
    } catch (SQLException e) {
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -