I have a string in java, but the data type in the database is Clob. How to get Clob from String?
clob.setString(position, string) writes a String object to a Clob object .
clob.setString(position, string)
new javax.sql.rowset.serial.SerialClob (source.toCharArray ())
To convert any string (small strings or large JSON converted to strings) to CLOB, we need to initialize the CLOB first:
CLOB clob = (CLOB) con.createClob(); clob.setString(position, "Any String Here");
Where conis the connection
con
Source: https://habr.com/ru/post/1785337/More articles:Delphi7 - How can I copy a file that is written to - file-ioHow to convert a text url to a clickable link on a PHP page? - urlHow to create Android source code with Google API? - androidКакие инструменты я могу использовать для просмотра diff двух разделов одного и того же файла? - pythonC # Create Notepad ++ as a search field - c #Sending JSON to the server - jsonUsing IUP with Lua on Ubuntu - luaShould I always use connection.close - asp-classicUsing Ruby OAuth to Connect to Yahoo Contacts API - restCSS sunken / pasted effect without using an image - cssAll Articles