如何在mysql储存二进制图片(java,jsp) 我记得mysql好像不行吧,换成存储路径吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 晕不是吧我一直用的都是mysql java.sql.SQLException: Syntax error or access violation语法错误或者权限问题咯.用户名和密码啊.你的SQL语法啊. 四个本问题的贴子至今没有任何人可以回答,全部都是可以啊,行啊,没问题啊没有任何代码证明我的信箱是 [email protected]收到可行代码立刻结贴送分http://community.csdn.net/Expert/topic/3638/3638776.xml?temp=.6011927http://community.csdn.net/Expert/topic/3637/3637320.xml?temp=.0927698http://community.csdn.net/Expert/topic/3638/3638807.xml?temp=.9520227http://community.csdn.net/Expert/topic/3638/3638773.xml?temp=.4013636 try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); String url ="jdbc:mysql://localhost/test?user=root&password=root&useUnicode=true&characterEncoding=gbk"; Connection conn = DriverManager.getConnection(url); Statement stmt = conn.createStatement(); stmt.execute("insert into test(myid) values (5)"); stmt.close(); PreparedStatement pstmt = null; String sql = ""; File file = new File("c:\\kick.jpg"); InputStream photoStream = new FileInputStream(file); sql = " UPDATE test SET photo = ? " + " WHERE myid = 5" ; pstmt = conn.prepareStatement(sql); pstmt.setBinaryStream(1, photoStream, (int)file.length()); pstmt.executeUpdate(); pstmt.close(); conn.close(); } catch (Exception e) { e.printStackTrace(); } 我用yahoo和sohu的发了过去。 FCKEditor如何替换输入的内容 谁能帮我把这里面的视频取下来? Struts2 页面跳转问题 请教ibatis 同类型的多表查询分页问题 PrintWriter的问题 NLS支持国际化的使用方法 在查询输入框中输入中文,查询完之后就乱码了 jsp上传文件 文件解析 NullPointerException的问题 jsp的时间函数是什么啊 乱吗问题 火急!connect db error!异常 解决送分
不是吧
我一直用的都是mysql
用户名和密码啊.
你的SQL语法啊.
没有任何代码证明我的信箱是 [email protected]
收到可行代码立刻结贴送分
http://community.csdn.net/Expert/topic/3638/3638776.xml?temp=.6011927
http://community.csdn.net/Expert/topic/3637/3637320.xml?temp=.0927698
http://community.csdn.net/Expert/topic/3638/3638807.xml?temp=.9520227
http://community.csdn.net/Expert/topic/3638/3638773.xml?temp=.4013636
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String url ="jdbc:mysql://localhost/test?user=root&password=root&useUnicode=true&characterEncoding=gbk";
Connection conn = DriverManager.getConnection(url);
Statement stmt =
conn.createStatement();
stmt.execute("insert into test(myid) values (5)");
stmt.close();
PreparedStatement pstmt = null;
String sql = "";
File file = new File("c:\\kick.jpg");
InputStream photoStream = new FileInputStream(file);
sql = " UPDATE test SET photo = ? "
+ " WHERE myid = 5" ;
pstmt = conn.prepareStatement(sql);
pstmt.setBinaryStream(1, photoStream, (int)file.length());
pstmt.executeUpdate();
pstmt.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();
}