First a disclaimer: I'm still learning my way around Oracle / JDBC etc so sorry if this is a dumb question.

I want to store large XML files in a column in my database, so I thought I would be best to use the XMLType.
I first tried
stmt.executeUpdate("INSERT INTO MR_XML VALUES('" + mr_id + "', XMLType('" + xml_string + "'))");
but this produced a java.sql.SQLException: ORA-01704: string literal too long

I understand from reading other posts that I should use a CLOB to store this, but I cannot find any examples of how to create a clob, assign the xml string to it and insert it into my table using jdbc.

After an afternoon spent googling and much trial and error, I now have
stmt.executeUpdate("INSERT INTO CLOB_TEMP VALUES('"+mr_id+"', empty_clob())"); 
pstmt = conn.prepareStatement("UPDATE CLOB_TEMP SET XML_CLOB = ? WHERE MR_ID='"+mr_id+"'"); 
pstmt.setString(2, xml_string);
but this throws a java.sql.SQLException: Data size bigger than max size for this type: 6183

Could someone please tell me what I am doing wrong and give me an example of how to get this working?

Thanks in advance