Developers and dba-do not connect via DSN TimesTen

Source: Internet
Author: User
Tags dba dsn failover

This paper presents a method of directly connecting a server-side DSN without having to define a DSN file on the client.
Of course, this is not a mainstream approach, just to open up ideas, more useful scenes can be used in the Ttisql utility, used to test automatic client failover.
This scenario can be found in the previous article: TimesTen Database replication learning: 16. A cache group, replication, the client automatically switch the skewers experiment

Pass the Ttisql test

The following is the server-side DSN file.

[sampledb_1122]Driver=/home/oracle/TimesTen/tt1122/lib/libtten.soDataStore=/home/oracle/TimesTen/tt1122/info/DemoDataStore/sampledb_1122PermSize=40TempSize=32PLSQL=1DatabaseCharacterSet=US7ASCII

On the client side we do not define the DSN and then use the TTISQLCS connection, note that Ttisqlcs is not ttisql. This also indicates that this method applies only to C/s connections, not direct connections.

$ Ttisqlcs"Ttc_server=localhost;tcp_port=53393;ttc_server_dsn=sampledb_1122;uid=tthr;pwd=timesten"Copyright (c)1996, the, Oracle and/orits affiliates. AllRights reserved.Type?or "Help"  forHelptype "Exit"  toQuit Ttisql.connect"Ttc_server=localhost;tcp_port=53393;ttc_server_dsn=sampledb_1122;uid=tthr;pwd=timesten"; Connection successful:dsn=; Ttc_server=localhost; ttc_server_dsn=sampledb_1122; Uid=tthr;datastore=/home/oracle/timesten/tt1122/info/demodatastore/sampledb_1122;databasecharacterset=us7ascii ; Connectioncharacterset=us7ascii; Permsize= +; Tempsize= +; Typemode=0;(DefaultSetting autocommit=1) command>Exit

The three properties actually used are: TTC_SERVER,TCP_PORT,TTC_SERVER_DSN.
Note that Tcp_port is the PID of the TimesTen server, not the PID of the TimesTen daemon.

Test with Java program

Because only the connection string is involved, it is only required to be in the source program of the

StringURL"jdbc:timesten:direct:DSN=sampledb_1122;uid=tthr;pwd=timesten";

Switch

StringURL"jdbc:timesten:client:ttc_server=localhost;tcp_port=53393;ttc_server_dsn=sampledb_1122;uid=tthr;pwd=timesten";

Can.

Before you change the Java source program, see:
Minimalist Java Connection TimesTen program

Conclusion
    • Only Java programs can now use this method to specify properties such as Ttc_server. For the C language, these properties can be directly written directly to the DSN file
    • This method only supports C/s connection, performance is inferior to direct connection. It does make sense for Java.
    • This method is extremely useful, and the auto client failover scenario can make the test more concise.
    • This method does not indicate that the client can not install the TimesTen client program
    • *
Reference

Howto:create a timesten JDBC client server connection without using the Sys.odbc.ini and Sys.ttconnect.ini client config uration files (Doc ID 1311810.1)

Developers and dba-do not connect via DSN TimesTen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.