惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - microtea

Jmeter多机联合产生负载 (转) 【转载】关于Java文件路径问题 - microtea - 博客园 安装CVSNT UTF-8的繁体与简体转换 - microtea - 博客园 利用MSSQL sp自制未公开的加密函数(转) wap开发的点小经验 no suitable driver 关于临时表的个人经验 - microtea - 博客园 java的对像克隆 在Redhat9上安装Oracle 9.2 SQL中的单记录函数 常用javascript Java:int 和 String 互相转换的多种方法 JAVA:Duplicate name in Manifest: Class-Path 关于The underlying connection was closed ServerVariables 集合环境变量列表 初步的对防盗连接的方法的设想 在asp.net中对web.config内容的添加 Asp.net(C#)中基于Forms验证的角色(用户组)验证授权过程
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 'xxx' 无效
microtea · 2006-01-10 · via 博客园 - microtea

大家在用java连接ms sql时可能会这样的问题
原因是sa用户为系统用户,它虽然能够登陆数据库,但是数据库里边的权限都是dbo的,所以,我们现在为这个数据库重新建立一个用户.
当然,这个情况只发生在java里边.   .net是不会这样的.
只要新建立一个用户,再在权限那分配权限做好就行了.

 public Connection getConnectionDB()
    {
     String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
     String ConnectionString = "jdbc:microsoft:sqlserver://localhost:1433; DatabaseName=test;";
     String userName = "username";
     String userPwd = "password";

     try {
     Class.forName(driverName);
     con = DriverManager.getConnection(ConnectionString, userName, userPwd);
     //System.out.println("Connection Successful!");
     }
     catch (Exception e) {
     e.printStackTrace();
     }

      return con;
    }

  ConnectionDB prod=new ConnectionDB();
    Connection con=prod.getConnectionDB();
    CallableStatement callStmt =null;
    java.sql.Statement  stat  =  null;
    java.sql.ResultSet  rs  =  null;
    
 
 
    stat  =  con.createStatement();
    String  sql="select * from table";
    rs=stat.executeQuery(sql);