Mega Code Archive

 
Categories / Java Tutorial / Database
 

How do you Store a Long Text Field in a Database

public static  void setLongString(PreparedStatement pstmt,  int parameterIndex, String data)       throws Exception {     // possibly a long string     pstmt.setAsciiStream(parameterIndex, new ByteArrayInputStream(data.getBytes()), data.length());   }