I have the following code:
public void StoreMapInDB(TreeMap<DateTime, Integer> 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,