您的位置:首页 > 数据库

Informix数据库连接使用方法整理

2010-12-17 19:17 761 查看
本文主要讲解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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: