Serializing a java card for db

I am using jdbc to work with my db. I want to save the HashMap directly in db, oracle. I think I need to serialize the map and its contents, which are only String. The map already implements Serializeable, but my question is how to put the map in SQL using jdbc? For example, I have jdbcTemplate.update ("insert into ....", new Object [] {....}, new int [] {....}) did I just put the map in an array of objects? Thanks

0
source share
2 answers

You need a table with key / value columns, and if you store several cards, an identification column (or a foreign key for another table that stores data from which hashmap is a member).

JDBC ( myhashmap (id, foreign_id, key, val) (?,?,?,?)) ONCE, hashmap, .

(, - , ).

String → Object, . I.e., "". , "rank" .

+2

, , - . "blob" Oracle.

/ ResultSet.setBytes() ResultSet.getBytes()

0

Source: https://habr.com/ru/post/1740747/


All Articles