You can write a simple test that shows how long it takes to connect to the database. For such things, I like Jython, which can work with JDBC, which can work with native JDBC drivers, and through the JDBC-ODBC bridge, it can work with the ODBC driver. Of course, you must first set up such an ODBC connection.
, :
import sys
import traceback
import time
from java.sql import DriverManager
from java.lang import Class
Class.forName("com.informix.jdbc.IfxDriver")
def test_conn(db_url, usr, passwd):
try:
t0 = time.time()
try:
db = DriverManager.getConnection(db_url, usr, passwd)
t2 = time.time()
print('%s' % (db_url))
print('%s, connection time %.03f [s]\n' % (db, (t2-t0)))
finally:
db.close()
except:
print("there were errors!")
s = traceback.format_exc()
sys.stderr.write("%s\n" % (s))
def main():
for _ in range(5):
test_conn('jdbc:informix-sqli://169.0.5.10:9088/test:informixserver=ol_t1;', 'user', 'passwd')
test_conn('jdbc:odbc:ifx_test', 'user', 'passwd')
main()
, JDBC JDBC-ODBC ( , , ). Windows, time.time() , , ~ 15 . :
jdbc:informix-sqli://169.0.5.10...
com.informix.jdbc.IfxSqliConnect@1658cfb, connection time 0.015 [s]
jdbc:odbc:test
sun.jdbc.odbc.JdbcOdbcConnection@ad75b, connection time 0.047 [s]
, , .