Chinaunix首页 | 论坛 | 博客
  • 博客访问: 594564
  • 博文数量: 110
  • 博客积分: 8016
  • 博客等级: 中将
  • 技术积分: 1217
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-28 10:14
文章分类

全部博文(110)

文章存档

2008年(1)

2007年(13)

2006年(96)

我的朋友

分类: Java

2006-06-28 15:28:39

 try{  

                Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");  

          }catch(java.lang.ClassNotFoundException   notClass){  

              System.out.println("no   find   the   driver   class");  

          }    

          try{  

                con=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs","sa","");  

          }catch(SQLException   sqlE){  

              System.out.println("exception:"+sqlE.getMessage());  

          }  

阅读(956) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~