Oracle RAW id columns and JDBC

后端 未结 2 1420
我寻月下人不归
我寻月下人不归 2021-01-29 03:01

I am trying to develop a simple Java servlet that calls an Oracle 11g XE database. The database I was provided uses RAW column types for the IDs on all tables.

Initiall

相关标签:
2条回答
  • 2021-01-29 03:33

    I have Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 and Java 1.6,
    this code work good

     Statement stmt = conn.createStatement();
           ResultSet rset = stmt.executeQuery("SELECT utl_encode.base64_encode(ID), NAME FROM raw_table");
            while (rset.next())
            {
                Object obj = rset.getString(1);
                logger.debug(obj);
            }
    

    Also i want to say, that Tom Kyte do not recommended use RAW Type.

    0 讨论(0)
  • 2021-01-29 03:34

    Try using RAWTOHEX and HEXTORAW.

    0 讨论(0)
提交回复
热议问题