JSP connection access database

xiaoxiao2021-03-06  20

TEST is the path, FOOT table name, Name field name of ODBC data original settings

<%

String Url = "JDBC: ODBC: TEST";

String driver = "sun.jdbc.odbc.jdbcodbcdriver";

Class.Forname (driver);

Connection conn = drivermanager.getConnection (URL, "", "");

Statement SqlStateMent = conn.createstatement ();

String SQL = "SELECT * from Foot";

// String SQL = "Update foot set usrname = 'baobo1' where id = 1";

ResultSet RS = SqlStatement.executeQuery (SQL);

While (rs.next ())

{

%>

  • <% = rs.getstring ("name")%>

    <%

    }

    %>

转载请注明原文地址:https://www.9cbs.com/read-61110.html

New Post(0)