是否可以通过另一个类连接到带有MySQL的JSP?
这是我自己的建议:
...<body>
<h3>The User List</h3>
<br>
<%
// JSP/Java kode
UsersDAPInterface users = new UserDAPClass(); // This java class contains mysql connection etc.
%>
</body>...
当我这样做的时候,我得到了很多错误和异常,包括ClassNotFound,NullPointer等。
我还得到了这个:
我无法从我的jsp连接到数据库。代码如下
<%
try {
/* Create string of connection url within specified format with machine name,
port number and database name. Here machine name id localhost and
database name is usermaster. */
String connectionURL = "jdbc:mysql://loca
我通过WAMP服务器在Tomcat和MySQL上运行JSP。我无法将JSP连接到MySQL。以下是代码
<%
try {
/* Create string of connection url within specified format with machine name,
port number and database name. Here machine name id localhost and
database name is usermaster. */
String connectionURL = "jdbc:mysql://localhost:3306/
我是一个新手,我想知道如何构建路径和所有到mysql.jar的,这样我就可以将它用于JSP,并且我已经创建了一个使用Tomcat配置的动态web项目。只有数据库连接没有发生。
错误是:
java.sql.SQLException : No suitable driver found for jdbc:mysql://localhost/pj_company
我必须使用Tomcat7.0和mysql数据库(5.1)在Eclipse(月亮)中构建一个动态web项目。我为用户创建了一个java类,在jsp和mysql之间创建了一个连接器java类,并创建了带有登录/注册表单的jsp页面。
这是user.java类:
package cop;
public class Company {
public String name = "";
public String username = "";
public String password = "";
public Strin
我对JSP很陌生。我正在尝试使用ADT编写一个JSP & MySQL连接的基本程序。在运行index.jsp页面时,我得到以下信息:
HTTP Status 500 - An exception occurred processing JSP page /index.jsp at line 24
type Exception report
message An exception occurred processing JSP page /index.jsp at line 24
description The server encountered an internal err