首页 文章

如何使用jsp在Web服务中上传图像?

提问于
浏览
-1

@WebService()public class UrmapsDatabaseManage {private static Connection getConnection()throws Exception {Class.forName(“com.mysql.jdbc.Driver”); String url =“jdbc:mysql:// localhost:3306 / dburmap”;返回DriverManager.getConnection(url,
“root”,“123”); }

上面是我与mysql db的连接 . 有人可以帮我做一个代码将图像插入我的数据库吗?请帮我 :(

1 回答

  • 0

    您应该考虑将图像上传到相对于您的webapp路径的某个位置,而不是将整个图像保存在数据库中,而只将该路径保存在数据库中 .

相关问题