JSP与数据库链接
来源:互联网 发布:网络棋牌交流群 编辑:程序博客网 时间:2024/05/23 10:45
<%@page import="java.awt.Button"%><%@ page contentType="text/html;charset=utf-8"%><%@ page import="java.sql.*"%><html><body><%Connection con;Statement sql;ResultSet rs;try{Class.forName("com.mysql.jdbc.Driver").newInstance();}catch(Exception e){out.print(e);}try{ String uri="jdbc:mysql://localhost:3306/iotregister"; con=DriverManager.getConnection(uri,"root","wqx818"); sql=con.createStatement(); rs=sql.executeQuery("SELECT * FROM student"); out.print("<table border=4>"); out.print("<tr>"); out.print("<th width=100>"+"姓名"); out.print("<th width=100>"+"时长"); out.print("</tr>"); while(rs.next()){ out.print("<tr>"); out.print("<td>"+rs.getString(1)+"</td>"); out.print("<td>"+rs.getString(2)+"</td>"); //添加按钮 out.print("<td><input type=\"button\" value=\"签到\" onclick = \"TimerGO(this,rs)\"></td>"); out.print("<td><input type=\"button\" value=\"离开\" onclick = \"TimerEnd(this,rs)\"></td>"); } out.print("</table>"); con.close();} catch(SQLException e1){out.print(e1);}%></body></html>
阅读全文
0 0
- JSP与数据库链接
- jsp与数据库的链接编码问题
- JSP链接mysql数据库
- jsp链接数据库方法
- jsp链接数据库方法
- jsp链接数据库代码
- jsp链接数据库
- JSP案例:之与各种数据库链接的案例代码
- jsp与mysql数据库链接,插入等操作
- 用JSP链接到数据库
- java jsp 链接access数据库
- JSP 链接各种数据库大全
- jsp链接数据库代码大全
- linux JSP 链接Mysql数据库
- 关于JSP链接数据库的问题
- 用JSP来链接数据库(DB类)
- JSP实例数据库常用链接方法
- JSP链接数据库大全(转)
- 颜色模式
- 泛型的作用及其基本概念
- leetcode-121. Best Time to Buy and Sell Stock
- 【笔试】:编程实现C++string 类成员函数
- 【小程序】微信小程序-滚动消息通知
- JSP与数据库链接
- Java基础总结
- mobilenet网络的理解
- C++编写字符串反转函数mystrrev(来源:西安交通大学-计算机程序设计-中国大学MOOC)
- 浅谈面向对象思想
- solr集群详细配置
- 在其他类调用本类(Activity)(单例)
- 详解从零开始配置汇编开发环境(DosBox,MasmPlus)
- 跨页面传值的几种简单方式