zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

mysql的longtext_老师,如何往MySQL中插入text和longtext类型的内容??

mysql 如何 类型 内容 插入 Text 老师 longtext
2023-06-13 09:11:32 时间

大家好,又见面了,我是你们的朋友全栈君。

request.setCharacterEncoding(“utf-8”);

String title = request.getParameter(“title”);

String container = request.getParameter(“area2”);

Connection conn = null;

Statement stmt = null;

String sql = “insert news1(title,container) values”

+ “(” + title + “,” + container + “)”;

try {

conn = DBhelper.getConnection();

stmt = conn.createStatement();

stmt.executeUpdate(sql);

response.sendRedirect(request.getContextPath() + “/success.jsp”);

} catch (Exception ex) {

ex.printStackTrace();

}

这是我用Servlet处理的,可是并没有写到MySQL中呀

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/146591.html原文链接:https://javaforall.cn