JSP 连接Oracle数据库, 哪里错了?

[复制链接]
查看11 | 回复3 | 2009-1-7 13:57:29 | 显示全部楼层 |阅读模式


您的第一个字段内容为:
您的第二个字段内容为:





报错:
An error occurred at line: 35 in the jsp file: /orctest.jsp
Syntax error, insert "}" to complete Block
An error occurred at line: 38 in the jsp file: /orctest.jsp
rs cannot be resolved
An error occurred at line: 40 in the jsp file: /orctest.jsp
stmt cannot be resolved
An error occurred at line: 36 in the jsp file: /orctest.jsp
conn cannot be resolved

回复

使用道具 举报

千问 | 2009-1-7 13:57:29 | 显示全部楼层
用这个试试:<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orcl为你的数据库的SIDString user="scott";String password="tiger";Connection conn= DriverManager.getCo...
回复

使用道具 举报

千问 | 2009-1-7 13:57:29 | 显示全部楼层
少个大括号 把所有的数据库操作都放入一个trycatch中 根本不会查出 哪一步报告的异常判断应该就是没有连接上...
回复

使用道具 举报

千问 | 2009-1-7 13:57:29 | 显示全部楼层
你看看你写的程序不是少个大括号 就是多个大括号 你好好看看...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行