jsp无法连接到oracle
Java code:
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<%
//import java.sql.*;
java.sql.Connection conn;
String Url="jdbc:oracle:thin:@192.168.1.106:1521:orcl";
String User="scott";
String password="tiger";
try
{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
conn=java.sql.DriverManager.getConnection(Url, User, password);
out.print("连接数据库成功");
}
catch(java.sql.SQLException e)
{
out.println(e.toString());
}
%>
在终端下运行是能够成功的,为何到jsp下就不行了?
出的什么问题或异常你总得贴出来吧...
异常
Java code:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occur
相关问答:
我现在想用ssh整合来做一个论坛,但数据库方面不行,我主要不会涉及数据库,不知道发帖表,和回帖表要如何设计和区分。不知道谁有一个简单的思路,来设计这些表。谢谢了。
发帖和回帖用同一张表 。发帖 id user ......
我是用STRUTS ,做了一个JSP页面,提交后没有存入数据库。
JSP代码如下:
aa.jsp代码
<%@ page contentType="text/html;charset=gb2312" language="java"%>
<%@ taglib uri=" ......
jsp中include.inc的作用是什么?
include.inc啥意思?没听说过
Java code:
<%include file="include.inc"%>加载网站目录include.inc文件内容
包含一个静态页面吧···
& ......
<html><head><title>[@title]</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<script language='javascript'>
function diyCheck ......
通过request.getHeader("Referer")可以获得上个页面的来源,有没有办法伪造这个referer属性.
response.setHeader("refresh","3;url='regiest.jsp'");
response.setHeader("re ......