import java.sql.*; public class test { public static void main(String[] args) throws Exception { String URL = "jdbc:mysql://localhost/kmng"; String USER = "root"; String PASS = ""; String DRIVER = "com.mysql.jdbc.Driver"; DriverManager.registerDriver((Driver) Class.forName(DRIVER).newInstance()); Connection con = DriverManager.getConnection(URL, USER, PASS); Statement st = con.createStatement(); ResultSet res = st.executeQuery("SELECT text FROM error WHERE id=1"); if(res.next()) { Clob c = res.getClob(1); c.truncate(0); c.setString(1,"öööööö"); PreparedStatement stmt = con.prepareStatement ( "UPDATE error SET text = ? WHERE id=1"); stmt.setClob ( 1, c ); stmt.executeUpdate(); stmt.close(); } res.close(); st.close(); con.close(); } }