我的測試機是/u/inf7.3
但是主機是HZTdatabase /u/inf7.3;
這裡有什麽不同?
我用java語言連接主機可以連接,但是連接不上測試機器,oninit,開了.
怎麽用java連接informix机器?linux+informix要怎樣配置和,我的windows機器要怎樣配置才能連接上?有沒有具體方案?
Class.forName("com.informix.jdbc.IfxDriver");
String url = "jdbc:informix-sqli://10.10.7.199:90991:informixserver=linux_tk";
/* String url = "jdbc:informix-sqli://10.10.7.1:9002/ndmahz:informixserver=on_tcp";*/
String user="informix";
String password="informix199"; /*String password="informix"; */
con = DriverManager.getConnection(url,user,password);
System.out.println("1");
exportTable("test01");
con.close();
}catch(Exception e){
e.printStackTrace();}
但是7.1的機器可以通過測試,7.199就不行,顯示錯誤
java.sql.SQLException: com.informix.asf.IfxASFException: ??????????·????÷ (linux_tk_tcp) ?§°???
at com.informix.jdbc.IfxSqliConnect.<init>(IfxSqliConnect.java:950)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at com.informix.jdbc.IfxDriver.connect(IfxDriver.java:243)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at test.ExportDb.<init>(ExportDb.java:41)
at test.ExportDb.main(ExportDb.java:144)
剛剛畢業做事,遇到問題頭都大了,望全國人民見諒!!!!
------解决方案--------------------------------------------------------
URL都是错的下面那个还是正确的
jdbc:informix-sqli://192.168.0.8:1526/ztdb:INFORMIXSERVER=ztdb_server;NEWCODESET=GBK,8859-1,819