摘要: package demo02; import javax.sql.DataSource; import org.apache.commons.dbcp.BasicDataSource; public class DBUtils { public static final String DRIVER = "com.mysql.jdbc.Driver"; public stat... 阅读全文
posted @ 2018-07-12 16:15 淅沥沥丶下雨 阅读(99) 评论(0) 推荐(0) 编辑
摘要: public static void insert() throws SQLException{ QueryRunner qr =new QueryRunner(); String sql ="insert into sort values(?,?,?)"; Object[] obj ={9,"橡皮擦","好吃又大补"}; ... 阅读全文
posted @ 2018-07-12 16:14 淅沥沥丶下雨 阅读(4538) 评论(0) 推荐(1) 编辑
摘要: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // 获取下载文件名称 String filename = request.getParameter("filename"); ... 阅读全文
posted @ 2018-07-06 11:25 淅沥沥丶下雨 阅读(289) 评论(0) 推荐(0) 编辑
摘要: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // 使用response获取字节输出流 ServletOutputStream out = response.getOutputStr... 阅读全文
posted @ 2018-07-06 11:23 淅沥沥丶下雨 阅读(279) 评论(0) 推荐(0) 编辑
摘要: //重定向 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // //1.设置状态码 // response.setStatus(302); // //2.设置响应头... 阅读全文
posted @ 2018-07-06 11:21 淅沥沥丶下雨 阅读(96) 评论(0) 推荐(0) 编辑
摘要: package demo05; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.n... 阅读全文
posted @ 2018-07-02 13:36 淅沥沥丶下雨 阅读(105) 评论(0) 推荐(0) 编辑
摘要: package demo04; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; public class TCPclient { public stat... 阅读全文
posted @ 2018-07-02 13:34 淅沥沥丶下雨 阅读(112) 评论(0) 推荐(0) 编辑
摘要: package demo02; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; public class UDPrecieve { public static void main(String[] args) throws IOException {... 阅读全文
posted @ 2018-07-02 12:00 淅沥沥丶下雨 阅读(80) 评论(0) 推荐(0) 编辑
摘要: package demo01;import java.io.IOException;import java.net.DatagramPacket;import java.net.DatagramSocket;public class UDPrecieve {public static void ma 阅读全文
posted @ 2018-07-02 11:59 淅沥沥丶下雨 阅读(76) 评论(0) 推荐(0) 编辑
摘要: package work; import java.io.FileReader; import java.io.IOException; import java.lang.reflect.Method; import java.util.Properties; /* (1)写一个Properties格式的配置文件,配置类的完整名称。 (2) 写一个程序,读取这个Properties配... 阅读全文
posted @ 2018-07-02 11:56 淅沥沥丶下雨 阅读(63) 评论(0) 推荐(0) 编辑