注册 登录
编程论坛 WEB前端(UI)

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

zzxwill 发布于 2008-05-16 02:14, 1113 次点击
这个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]]
1 回复
#2
a485676532008-05-16 19:26
看看连接字符串
1