Java Oracle: Storing a TreeMap as BLOB?

I have the following code: public void StoreMapInDB(TreeMap map) throws IOException, FileNotFoundException{ try { PreparedStatement insertMap = null; String insertString = "INSERT INTO TESTMAP(ID, NAME) VALUES (1, ?)"; Connection con=null; con.setAutoCommit(false); Class.forName("oracle.jdbc.driver.OracleDriver"); con=DriverManager.getConnection( "jdbc:oracle:thin:@XXXXX", "XXX", "XXX"); //This line is incorrect for sure //insertMap.setBlob(1, map.); } catch(Exception e){e.printStackTrace();} } The connection works and all with database. This time i am trying to insert the map i.e. the treemap i created into a column in the table with type BLOB. How can I do that? is there any other better datatypes that I should look into? Thanks,

以上就是Java Oracle: Storing a TreeMap as BLOB?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准