记录一下Erel的jRDC2的用法(连接SQL Server)

bigluo

Member
基本用法示例里面都有,但有两个地方没提,我前后研究了两天才搞清楚,在这里列出来,仅供参考:
1. SQL Server 要开启TCP/IP服务,并且要打开1433端口
2. 配置文件 config.properties 里面不能有中文,因为java 9之前的版本,打开配置文件时,默认的编码问题,里面的中文读出来是乱码,解决方法就是要自己转
3. 连接配置大概就是这样,SQL Server里面的 mysert\SQLEXPRESS的实例名称,是不用输入的
B4X:
DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://localhost/my_db_name
User=my_username
Password=my_password
 

aeric

Expert
Licensed User
Longtime User
也许你可以参考我的教程
 

bigluo

Member
根据我的搜索,是这样的:
B4X:
 .properties files are expected to be encoded in ISO 8859-1. One can use unicode escapes to specify other characters. There is also a tool available to do the conversion.
 

aeric

Expert
Licensed User
Longtime User
感谢分享这信息
 

bigluo

Member
感谢分享这信息
老大,碰到难题了,可以帮忙看一下吗?谢谢!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…