将本地文件上传至服务器

xiaoxiao2021-02-28  40

(上传至新浪云服务器) 1.修改DBHelper的连接方式 static{         try {             Class.forName("com.mysql.jdbc.Driver");         } catch (ClassNotFoundException e) {             e.printStackTrace();         }     }     /**      * 获取连接      *      * @return      */     private Connection getConnection() {         Connection con = null;         try {             String username = System.getenv("ACCESSKEY");             String password = System.getenv("SECRETKEY");                          con=DriverManager.getConnection("jdbc:mysql://w.rdc.sae.sina.com.cn:3306/app_qiji",username,password);         }  catch (SQLException e) {             e.printStackTrace();         }         return con;     } 2.修改FileUpload的服务器文件夹路径,将路径改到本地
转载请注明原文地址: https://www.6miu.com/read-1400052.html

最新回复(0)