首 页 行业热点 新车 试驾评测 养车用车 车型库

请问,在vs2005中,c#怎么连接linux 中的informix 数据库?

发布网友

我来回答

1个回答

热心网友

内容是转载的,希望对你有所帮助。

Windows下连接Linux中的Informix数据库的两种实用方法:用MyEclipse直接连接Informix数据库和用ODBC连接Informix数据库。

项目中用到的开发相关资料主要有:

系统开发环境:Windows+Linux

Windows开发软件:MyEclipse5.5+IBM Informix Client-SDK 2.90+FlashFXP

Linux软件:Informix11数据库

相关技术:JSP+Struts+JavaBean+Informix

方式一:MyEclipse直接连接Informix数据库

准备文件有:d:\ifxjdbc.jar

操作步骤:"开始"--“所有程序”--“MyEclipse 5.5”--"Windows"--"Open Perspctive"--"My Eclipse Database Explorer" 打开DB Browser窗体,鼠标右键"new"新建一个数据库连接

Driver name:自定义连接标识( 如informix.jdbc.IfxDriver)
nnection URL:jdbc:informix-sqli://192.168.1.249:9000/databasename:informixserver=informixservername;newcodeset=GBK,8859-1,819
User name: informix
Password: informix
Driver JARs :d:\ifjdbc.jar

其中192.168.1.249为Linux服务器IP,databasename为Linux服务器数据库名和informixservername为Linux服务器数据库服务名称

方式二:ODBC连接Informix数据库
1.安装IBM Informix Client-SDK 2.90

2.打开控制面板--数据源(ODBC)--新建一个新的系统DSN,设置如下:

Server Name: Informix Server
Host Name :192.168.1.249
Service :sqlexecl
protocol :onsoctcp
Options :
Database Name :DataBaseName
User Id : Informix User Name
Password : Informix Password

3.设置Windows系统文件service内容
C:\WINDOWS\system32\drivers\etc\service
man 9535/tcp #Remote Man Server
sqlexecl 9003/tcp #Remote Linux Informix Data Server

3.设置Windows系统文件hosts内容
C:\WINDOWS\system32\drivers\etc\hosts
127.0.0.1 localhost
192.168.1.249 LinuxMachineName

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com