本文发表在 rolia.net 枫下论坛测试程序isql用法如下:
[root@hippo9 fortest]#isql –v FIAT userid passwd
[root@hippo9 fortest]#isql –v FIAT userid passwd
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select * from hl_daemon
SQL>
[root@hippo9 fortest]#
[root@hippo9 fortest]#
isql测试成功说明配置及网络等都正常.但是执行一个使用unixodbc API的程序就只输出:
[root@hippo9 fortest]# ./odbc
Error SQLConnect -1
[unixODBC][Driver Manager]Data source name not found, and no default driver specified (0)
[root@hippo9 fortest]#
程序源码来自于:
http://www-128.ibm.com/developerworks/cn/linux/database/odbc/index.html
我的配置文件如下:
[root@hippo9 etc]# cat /usr/local/etc/odbcinst.ini
[TDS]
Description = FreeTDS
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtdsS.so.1
UsageCount = 1
[root@hippo9 etc]# cat /usr/local/etc/odbc.ini
[FIAT]
Driver = TDS
Description = ODBC connection via FreeTDS
Trace = Yes
TraceFile = /tmp/sql.log
ServerName = MYFIAT
Database = hiplink
Port = 1433
[root@hippo9 etc]# cat /usr/local/etc/freetds.conf
[JDBC]
host = 192.138.151.39
port = 4444
tds version = 5.0
[JDBC_42]
host = 192.138.151.39
port = 4444
tds version = 4.2
[mypool]
host = 127.0.0.1
port = 5000
tds version = 4.2
[MYFIAT]
host = 192.168.50.131
port = 1433
tds version = 8.0更多精彩文章及讨论,请光临枫下论坛 rolia.net
[root@hippo9 fortest]#isql –v FIAT userid passwd
[root@hippo9 fortest]#isql –v FIAT userid passwd
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select * from hl_daemon
SQL>
[root@hippo9 fortest]#
[root@hippo9 fortest]#
isql测试成功说明配置及网络等都正常.但是执行一个使用unixodbc API的程序就只输出:
[root@hippo9 fortest]# ./odbc
Error SQLConnect -1
[unixODBC][Driver Manager]Data source name not found, and no default driver specified (0)
[root@hippo9 fortest]#
程序源码来自于:
http://www-128.ibm.com/developerworks/cn/linux/database/odbc/index.html
我的配置文件如下:
[root@hippo9 etc]# cat /usr/local/etc/odbcinst.ini
[TDS]
Description = FreeTDS
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtdsS.so.1
UsageCount = 1
[root@hippo9 etc]# cat /usr/local/etc/odbc.ini
[FIAT]
Driver = TDS
Description = ODBC connection via FreeTDS
Trace = Yes
TraceFile = /tmp/sql.log
ServerName = MYFIAT
Database = hiplink
Port = 1433
[root@hippo9 etc]# cat /usr/local/etc/freetds.conf
[JDBC]
host = 192.138.151.39
port = 4444
tds version = 5.0
[JDBC_42]
host = 192.138.151.39
port = 4444
tds version = 4.2
[mypool]
host = 127.0.0.1
port = 5000
tds version = 4.2
[MYFIAT]
host = 192.168.50.131
port = 1433
tds version = 8.0更多精彩文章及讨论,请光临枫下论坛 rolia.net