org.hsql.jdbcDriver与在TOMCAT配置JNDI有什么关系吗?

zhaoxuefeng 2003-06-14 12:07:12
我在TOMCAT上配置JNDI时,在运行JSP网页时出现找不到org.hsql.jdbcDriver类的错误,不知是哪儿配置错了?
org.hsql.jdbcDriver这个类在哪儿能下载?

jsp程序:
<%@ page import="javax.naming.*,java.sql.*,javax.sql.*"%>
<%
try{
String dbName ="java:comp/env/jdbc/web";
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup(dbName);
Connection con = ds.getConnection("sa","sa");

if(con!=null)
{
con.close();
}
}catch(Exception e){out.println(e);}
%>
...全文
70 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ZeroC 2003-06-14
  • 打赏
  • 举报
回复
这种数据库就是一jar包,不用安装
ZeroC 2003-06-14
  • 打赏
  • 举报
回复
这是hypsonic数据库,要到http://sourceforge.net/project/showfiles.php?group_id=23316&release_id=35298
zhaoxuefeng 2003-06-14
  • 打赏
  • 举报
回复
谢谢
这个包我已经下载,上面的程序已经没有错误了,但是我

Statement comm=null;
ResultSet rs=null;
String QueryString="select username from userreg_table";
try{
String dbName ="java:comp/env/jdbc/pepweb";
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup(dbName);
Connection con = ds.getConnection();
comm=con.createStatement();
rs=comm.executeQuery(QueryString);
while (rs.next())
{
out.println(rs.getString("username"));
}
con.close();
}catch(Exception e){out.println(e);}


它时出现java.sql.SQLException: Table not found: USERREG_TABLE in statement [select username from userreg_table]
我的库里有这个表,而且我用JSP直接连库时能读出来?
是不是这个池没有建立起来呢?

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧