使用unidac 在linux 上无驱动直接访问MS SQL SERVER
随着delphi 10.2 开始了对Linux 的重新支持。devart 也迅速的发布了unidac 7.0,
最大的特性就是支持linux和MongoDB.
并有了其他更新:
In this release we added such significant features as:
- The new UniDAC version includes a new MongoDB provider which allows you to work with a cross-platform document-oriented database MongoDB. Its main features are high performance, easy deployment and comprehensive support for the latest versions of the MongoDB server.
- In DBF provider, we added support for the Direct mode. Using DBF data provider, you can work with a variety of database formats: dBaseIII-dBase10, dBase for Windows, HiPer-Six, FoxPro 2, Visual FoxPro.
- Now, working with Oracle in the Direct mode becomes more appealing, we supported Oracle 12c authentication, Oracle Cloud (DbaaS), Oracle Encryption, Oracle Data Integrity. We also added support for the ANYDATA type.
- What is more, for Interbase and Firebird, you have an opportunity to manage batch operations using a transaction and to obtain an active transaction number using DBMonitor.
- In NexusDB data provider, we added support for using ConnectionString and the TFmtBCD fields.
更多的情况可以访问官网www.devart.com .此公司在数据库存取方面的功力,已经逆天。
今天给大家说的是利用undiac 的直连数据库功能,在Linux下不安装任何驱动,访问MS SQLSERVER 功能。
如果你没有现成的sql server 数据库,可以直接在微软的网页上下载sql server 2016 express 版,此版本为免费版本。
安装后,启动TCP/IP 支持,同时注意windows 防火墙的设置,确保网络访问正常。
在windows 上,使用客户端程序,建立一个sql server 数据库,同时建一个测试表。
输入一些测试数据
OK, 准备结束。启动delphi。
新建一个控制台工程。
再建一个datamodule
放上对应的控件
注意uniconnection 的属性设置
ok, 设置完毕
回到主程序。
program linuxdata; {$APPTYPE CONSOLE} {$R *.res} uses
System.SysUtils,System.Classes,
dmp in 'dmp.pas' {dmf: TDataModule}; var
i:integer;
s:string;
begin try
dmf:=Tdmf.Create(nil);
dmf.UniConnection1.Connected:=true;
writeln('数据库版本:'+dmf.UniConnection1.ServerVersionFull);
with dmf.cx do
begin
SQL.Clear;
sql.Add('select * from TB_user');
open;
for I := to fields.Count- do
begin
write('|');
write( fields[i].FieldName);
end;
writeln('|');
while not eof do
begin
for I := to fields.Count- do
begin
write('|');
write( fields[i].AsString) ;
end;
writeln('|');
next;
end;
end;
writeln('打完收功!');
readln; except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
在windows 上运行无误。
添加linux 平台编译支持
编译,运行程序
结果出来了。与windows 下没任何区别。
记住:我们没有在linux 下安装任何sql server 驱动。
用delphi 就这么自信!
另外,以上人名,纯属虚构,如有雷同,爱理不理。
使用unidac 在linux 上无驱动直接访问MS SQL SERVER的更多相关文章
- (provider: 共享内存提供程序, error: 0 - 管道的另一端上无任何进程。) (Microsoft SQL Server,错误: 233)
------------------------------ 无法连接到 IFCA-LIUWEI/SQL2005. ------------------------------其他信息: 已成功与服务 ...
- sql server 2008启动时:已成功与服务器建立连接,但是在登录过程中发生错误。(provider:命名管道提供程序,error:0-管道的另一端上无任何进程。)(Microsoft SQL Server,错误:233) 然后再连接:错误:18456
问题:sql server 2008启动时:已成功与服务器建立连接,但是在登录过程中发生错误.(provider:命名管道提供程序,error:0-管道的另一端上无任何进程.)(Microsoft S ...
- Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码)
Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码) http://blog.csdn.net/helonsy/article/details/7207497 ...
- .net core连接Liunx上MS SQL Server
场景 由于业务要求,需要对甲方的一个在SQL Server上的财务表进行插入操作.研究了半天,因为一个小问题折腾了很久. 过程 .net core端: 1. 利用EF,就需要的导入相关的Nuget包, ...
- XVFB实现selenium在linux上无界面运行安装篇
selenium在linux上无界面运行,其实是非常简单的.具体的方法有使用HtmlUnitDriver或者PhantomJSDriver,有时间我会写写关于这两个东东的文章,其实基本和ChromeD ...
- Linux上通过MySQL命令访问MySQL数据库时常见问题汇总
Linux上通过mysql命令访问MySQL数据库时常见问题汇总 1)创建登录账号 #创建用户并授权 #允许本地访问 create user 'test'@'localhost' identified ...
- TQ2440学习笔记——Linux上I2C驱动的两种实现方法(1)
作者:彭东林 邮箱:pengdonglin137@163.com 内核版本:Linux-3.14 u-boot版本:U-Boot 2015.04 硬件:TQ2440 (NorFlash:2M Na ...
- Linux上实现Windows的SQLPlus保存SQL历史记录功能
在Windows操作系统上,当在DOS命令窗口中运行SQL*Plus的时候,可以使用向上,向下键来跳回之前已经执行过的SQL语句.你可以根据需要修改他们,然后按Enter键重新提交执行. 然而,当在L ...
- Linux上 Can't connect to X11 window server using XX as the value of the DISPLAY 错误解决方法
在Linux上运行需要图形界面的程序时出现如下错误提示: No protocol specified Exception in thread "main" java.awt.AWT ...
随机推荐
- mysql 5.7.21 主从集群恢复GTID方式(不锁库)
从库损坏后,进行恢复 1.查看主加标记点 show master status\G 记录下POST的值 2.备注主库数据 mysqldump -u root -p -S /data/mysql/mys ...
- 调整数组顺序使奇数位于偶数前面(python)
题目描述 输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有的奇数位于数组的前半部分,所有的偶数位于数组的后半部分,并保证奇数和奇数,偶数和偶数之间的相对位置不变. # -*- codi ...
- 牛客练习赛43-F(简单容斥)
题目链接:https://ac.nowcoder.com/acm/contest/548/F 题意:简化题意之后就是求[1,n]中不能被[2,m]中的数整除的数的个数. 思路:简单容斥题,求[1,n] ...
- PAT1020 (已知中序,后序遍历转前序遍历)
已知后序与中序输出前序(先序):后序:3, 4, 2, 6, 5, 1(左右根)中序:3, 2, 4, 1, 6, 5(左根右) 已知一棵二叉树,输出前,中,后时我们采用递归的方式.同样也应该利用递归 ...
- Python 学习笔记---爬取海贼王动漫
最近无聊整理的爬虫代码,可以自动爬取腾讯动漫的任意漫画,思路如下: 1. 先获取想下载的动漫url, 这里用了 getUrls ,直接获取动漫的最后一章 2. 然后进入到该动漫去获取要下载的图片url ...
- Hive和并行数据仓库的比较
最近分析和比较了Hive和并行数据仓库的架构,本文记下一些体会. Hive是架构在Hadoop MapReduce Framework之上的开源数据分析系统. Hive具有如下特点: 1. 数据以HD ...
- bbs项目实现点赞和评论的功能
一.点赞功能 思路是这样的: 1.对点赞和踩都设置一个相同的class,然后对这个class绑定点击事件 2.点击触发ajax请求,我们对赞的标签设置了一个class属性,对踩的标签没有设置这个cla ...
- SQL创建删除索引
--创建唯一聚集索引create unique clustered index pk_table1 on table1 (column1) --创建唯一非聚集索引create unique noncl ...
- SY-SUBRC
一般是对read table和select语句使用. loop at g_it_data where level < <wa_data>-level and seq < < ...
- console框脱离eclipse窗口
解决方案: 直接将视图重置. 在eclipse主窗口的最上层选项中,点击“window”选项,找到其中的“Reset Perspective”选项,点击确认即可.即视图重置.