SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 953|回复: 1
打印 上一主题 下一主题

怎么用JDBC连接SAS数据库??

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2011-1-7 10:03:12 | 只看该作者

怎么用JDBC连接SAS数据库??

怎么用JDBC连接SAS数据库??能否给我介绍一下?我的邮箱:itibm@126.com
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
沙发
 楼主| 发表于 2011-1-10 12:21:42 | 只看该作者

Re: 怎么用JDBC连接SAS数据库??

Getting a JDBC Connection Object
Java Database Connectivity (JDBC) defines the standard way for Java programmers to access and manipulate data in a database. The IOM server supports IOM objects that provide all the functionality of a JDBC driver, but, instead of having to learn to program for those IOM objects, SAS Integration Technologies provides you with a JDBC implementation that uses IOM objects internally.

After you have established a connection to an IOM server and obtained a reference to a stub for the workspace component, you can get a java.sql.Connection object for the SAS JDBC Driver, as shown in the following example:

  import java.sql.Connection;
  import java.sql.SQLException;
  import java.util.Properties;
  import com.sas.iom.SAS.IDataService;
  import com.sas.rio.MVAConnection;

  //use workspace factory to get reference to workspace stub
  //IWorkspace sasWorkspace = ...
  IDataService rio = sasWorkspace.DataService();
  Connection sqlConnection = new MVAConnection(rio,new Properties());
     .
     .
     .
     (standard JDBC method calls)
     .
     .
     .


The following example shows you how to release the connection:
     sqlConnection.close();

以上参考一下,个人认为可能还是需要SAS/SHARE的支持。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-6-13 18:27 , Processed in 0.066440 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表