Home  >  Article  >  Database  >  JSP连接Mysql数据库

JSP连接Mysql数据库

WBOY
WBOYOriginal
2016-06-07 16:06:001206browse

我写的一个用JSP连接MySQL数据库的代码。 要正确的使用这段代码,你需要首先在MySQL数据库里创建一username表,表里面创建两个字符型的字段,字段名分别为:uid,pwd,然后插入几条测试数据。 以下用两种方式来实现JSP连接MySql数据库。 第一种方式,用JSP实

我写的一个用JSP连接MySQL数据库的代码。

要正确的使用这段代码,你需要首先在MySQL数据库里创建一username表,表里面创建两个字符型的字段,字段名分别为:uid,pwd,然后插入几条测试数据。

以下用两种方式来实现JSP连接MySql数据库。

第一种方式,用JSP实现。

<p> import="java.sql.*"%><br><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><br>     //**************************************<br>     *********  JDBC_ODBC杩</p>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn