JSP连接SQL SERVER 2008 找不到驱动
哪位高手能帮我看下为什么抛出这些异常?
代码
<%@ page language="java" import="java.util.*" contentType="text/html; charset=ISO-8859-1"
pageEncoding="GB2312"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:directive.page import="java.lang.Class"/>
<jsp:directive.page import="java.sql.DriverManager"/>
<jsp:directive.page import="java.sql.Connection"/>
<jsp:directive.page import="java.sql.Statement"/>
<jsp:directive.page import="java.sql.ResultSet"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SQL Server 2008</title>
</head>
<body topmargin="0">
<%
out.println("hello");
String driverClass="com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=JSP_TEST";
String username="DONGJIN";
String password="dongjin";
try
{
Class.forName(driverClass);
}
catch(ClassNotFoundException e)
{
out.println("------在加载数据库驱动时抛出异常,内容如下:");
e.printStackTrace();
}
Connection conn=DriverManager.getConnection(url,username,password); //建立连接
Statement stmt=conn.createStatement(); //创建连接状态
ResultSet rs=stmt.executeQuery("select * from table1"); //执行select语句
%>
<tr>
<td align="center">
<table width="30%" bordercolor="#00CC66" border="1">
<tr align="center" bgcolor="#FF6633">
<td>编号</td>
&nb
相关文档:
<!--MySql 驱动程序 eg. mysql-connector-java-5.0.4-bin.jar-->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- JDBC URL -->
......
1.ession内的存放的是对象的引用,所以修改内置对象后,不需要重新放置到session中
2.配置Context初始化参数
<Context-param>
<param-name></paran-name>
<param-value></param-value>
<Context-param>
this.getServletContext().getInitParameter(arg0);
--------------------- ......
SAP 使用SQL Trace(ST05)
SAP R/3 提供标准ABAP SQL 跟踪工具。使用T-Code:ST05 可以进入追踪设定画面:
在Trace Modes 区域中选择需要在SAP R/3 Server 上trace 的范围:
SQL Trace: 追踪该A ......
新建表:
create table [表名]
(
[自动编号字段] int IDENTITY (1,1) PRIMARY KEY ,
[字段1] nVarChar(50) default '默认值' null ,
[字段2] ntext null ,
[字段3] datetime,
[字段4] money null ,
[字段5] int default 0,
[字段6] Decimal (12,4) default 0,
[字段7] image null ,
)
删除表:
Drop table [表 ......