zzxwill 发表于 2008-5-16 02:15

Done这个jsp程序为什么不能连接数据库?

这个jsp程序为什么不能连接数据库?
<%@page contentType="text/html"%>
<%@page pageEncoding="GB2312"%>
<%@page import ="java.sql.*" %>

<%
String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";  
      Class.forName(driverName);
   Connection dbConn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433; DatabaseName=VRManagementSystem", "sa", null);
   Statement smt=dbConn.createStatement();
String sql="create table persondata1121 "+"(ID char(10),Name char(10))";
smt.execute(sql);
%>

[[it] 本帖最后由 zzxwill 于 2008-6-7 13:29 编辑 [/it]]

ltdtfking 发表于 2008-5-17 01:55

报的是什么错,还有你在做数据库连接时导没导包?[tk07]

killer_l 发表于 2008-5-17 11:22

drivename是什么?

ming206 发表于 2008-5-17 15:24

MSSQL的数据库包你有没有?

ltdtfking 发表于 2008-5-21 20:39

你用的是纯java驱动有没有把包导到工程里

Ethip 发表于 2008-5-21 23:12

回复 1# 的帖子

不知道解决了没有,以上各位的意见良好!
[tk10]

页: [1]

编程论坛