我有一个java应用程序,我需要在SQL Server数据库中存储日志数据,如会话,消息和事件日志。我使用com.microsoft.sqlserver.jdbc.SQLServerDriver引用SQLjdbc4.jar进行数据库连接。除此之外,我还使用了所有支持罐(例如proxool.jar,com.springsource.org.logicalcobwebs.cglib.core-0.9.1.jar)。 我仍然无法连接数据并将数据记录到数据库中。 是否使用了代码或罐子中的任何错误?
例外情况如下:
INFO: [FIX.4.4:FIXCLIENT->FIXSERVER] daily, 00:00:00-UTC - 00:00:00-UTC
INFO FXClient - Error in login : error during session initialization
quickfix.ConfigError: error during session initialization
at quickfix.mina.initiator.AbstractSocketInitiator.createSessions
(AbstractSocketInitiator.java:169)
at quickfix.mina.initiator.AbstractSocketInitiator.createSessionInitiators
(AbstractSocketInitiator.java:84)
at quickfix.SocketInitiator.initialize(SocketInitiator.java:86)
at quickfix.SocketInitiator.start(SocketInitiator.java:64)
at client.FXClient.login(FXClient.java:137)
at client.FXClient.startClient(FXClient.java:76)
at client.FXClient.main(FXClient.java:59)
Caused by: quickfix.RuntimeError: com.microsoft.sqlserver.jdbc.SQLServerException: The connection to
the host ABC, named instance XYZ_2008 has failed. Error: "java.net.SocketTimeoutException:
Receive timed out". Verify the server and instance names, check that no firewall is blocking UDP
traffic to port 1434, and for SQL Server 2005 or later verify that the SQL Server Browser Service is
running on the host.

正常的数据库连接在相同的SQl服务器上运行良好。
答案 0 :(得分:0)
此问题是quickFixJ JDBC日志记录。 我使用SQl数据源解决了这个问题。 我已将SQL数据源对象设置为JDBCStoreFactory和JDBCLogFactory数据源。 QuickFIXJ提供所有必要的实用程序。 请在下面找到相同的代码段。
JdbcStoreFactory objJSF = new JdbcStoreFactory(settings);
JdbcLogFactory objJLF = new JdbcLogFactory(settings);
SQLServerDataSource ds = new SQLServerDataSource();
ds.setServerName(<SERVER_NAME);
ds.setDatabaseName(<quickfix_database_name>);
ds.setInstanceName(<INSTANCE_NAME>);
ds.setIntegratedSecurity(AUTHMODE.toUpperCase().contains("WINDOW") ? true : false);
objJSF.setDataSource(ds);
objJLF.setDataSource(ds);
storeFactory = objJSF;
logFactory = objJLF;
MessageFactory messageFactory = new MessageFactory();
initiator = new SocketInitiator(application, storeFactory, settings, logFactory, messageFactory);