zoukankan      html  css  js  c++  java
  • 作为.net程序员学jsp,伤不起



    <%@page import="java.sql.*"%>
    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
    + request.getServerName() + ":" + request.getServerPort()
    + path + "/";
    %>


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <base href="<%=basePath%>">


    <title>My JSP 'dbexample1.jsp' starting page</title>


    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->


    </head>
    <body>


    <%
    Class.forName("com.mysql.jdbc.Driver");
    Connection connection = DriverManager.getConnection(
    "jdbc:mysql://localhost:3306/phpcms", "root", "");
    Statement statement = connection.createStatement();
    ResultSet rs = statement
    .executeQuery("select email from v9_admin where username='phpcms'");
    while (rs.next()) {
    out.println(rs.getString(1));
    %>
    <br>
    <% } %>
























    </body>
    </html>
  • 相关阅读:
    点击两次返回键程序退出
    权限android.permission.WRITE_EXTERNAL_STORAGE 内外置sd卡写权限
    java Calendar add方法
    MeasureSpec简介
    android bitmap转换
    IOS键盘隐藏和显示调用
    内存溢出
    UIView递归
    caLayer
    C++算法
  • 原文地址:https://www.cnblogs.com/shugen/p/6863036.html
Copyright © 2011-2022 走看看