jsp+sql 非常简单的连接的问题 (救命。。。。) 驱动应该没什么问题,呵呵,是不是就是把三个文件拷贝到resin中lib的目录下面啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 高手,能不能帮忙look look??谢了先 <%@ page contentType="text/html; charset=GBK" %><%@ page import= "java.sql.*" %><html><head><title>jsp_sqlserver</title></head><body bgcolor="#ffffff"><h1>JBuilder Generated JSP</h1><br><% try { Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); out.println("找到驱动!!"); Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=merchant","sa",""); out.println("conn:"+conn); out.println("连接成功!!!"); Statement statement = conn.createStatement(); ResultSet authorName = statement.executeQuery("select * from tbuser"); out.println("执行查询!!!"); while(authorName.next()) out.println("<tr><td>"+authorName.getString(1)+"</td></tr><br>"); } catch(ClassNotFoundException e) { out.println("Driver unavailable!!!!"); } catch(SQLException e) { System.err.println(e); }%></body></html>应该是你的驱动写的不对,你参考一下这个 hibernate关联关系 各位大虾,我急于请教一个IFRAME的问题。 各位有沒有好的JSP教程的下載的地址 简单错误,寻求解决办法! 如何禁用客户端ie的自动记录密码的功能? 谁有文件"下载"的例子? 有谁知道DW里字体的大小和WORD里的字体大小的关系! 谈谈“文件上传“的思路?大哥请指教 如何刷新Modal窗口 ClassNotFoundException: his.Client jsp 自定义函数 输出问题 有没有使用数组的例子
<%@ page import= "java.sql.*" %>
<html>
<head>
<title>
jsp_sqlserver
</title>
</head>
<body bgcolor="#ffffff">
<h1>
JBuilder Generated JSP
</h1><br>
<%
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
out.println("找到驱动!!");
Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=merchant","sa","");
out.println("conn:"+conn);
out.println("连接成功!!!");
Statement statement = conn.createStatement();
ResultSet authorName = statement.executeQuery("select * from tbuser");
out.println("执行查询!!!");
while(authorName.next())
out.println("<tr><td>"+authorName.getString(1)+"</td></tr><br>");
}
catch(ClassNotFoundException e)
{
out.println("Driver unavailable!!!!");
}
catch(SQLException e)
{
System.err.println(e);
}%>
</body>
</html>
应该是你的驱动写的不对,你参考一下这个