jsp中连入数据库的问题
刚开始的时候,没有在jsp中写任何的显示语句,只写入了连接数据库的一些东西。
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String url="jdbc:sqlserver://10.1.0.10:1433";
String user="sa";
String pwd="123";
Connection conn=DriverManager.getConnection(url,user,pwd);
连接时没有报任何的错误,但是在连接具体的表和写sql语句时,就出现了无效的对象名 “article”,article是我的表的名字。后面的代码如下:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String url="jdbc:sqlserver://10.1.0.10:1433";
String user="sa";
String pwd="123";
Connection conn=DriverManager.getConnection(url,user,pwd);
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select * from dbo.article");
连接时出现这样的错误:
严重: Servlet.service() for servlet jsp threw exception
com.microsoft.sqlserver.jdbc.SQLServerException: 对象名 'dbo.article' 无效。
at com.microsoft.sqlserver.jdbc.SQLServerException.makefromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown Source)
at com.microsoft.sqlse
相关问答:
//用客户的session的id建立一个临时文件:
//String tempFileName=(String)session.getId();
String tempFileName = (String)session.getId();
//out.println(& ......
我想用javabean实现计数
代码如下:
ComputerCount.java
package tom.jiafei;
import java.io.*;
public class ComputerCount{
int number=0;
boolean iscome=false;
File file=new ......
不知道jsp中的上传和下载怎么实现,
需要源代码,而且有几种方法可以实现?
&nb ......