I am developing an application using hibernate.when I try to set the "CONNECTION_AUTHENTICATION" signature via hibernate,it is returning error "node to traverse cannot be null".am i missing something.could you please help me to understand,how to set CONNECTION_AUTHENTICATION in hibernate...

asked 02 Aug '13, 06:05

Vijay%20S's gravatar image

Vijay S
105235
accept rate: 0%

edited 02 Aug '13, 06:25

Volker%20Barth's gravatar image

Volker Barth
31.5k318461676

I'm not familiar with Hibernate but I guess you should either be able to embed the SET TEMPORARY OPTION statement

  • in a call executeUpdate method on a JDBC statement or
  • add the InitSting connection parameter to the JDBC connection string - cf. this doc page:

Authentication statement execution

(02 Aug '13, 06:23) Volker Barth

Which JDBC driver are you using with Hibernate - jConnect or the SQL Anywhere JDBC driver?

  • jConnect: As per the jConnect documentation, there is a connection property SQLINITSTRING that can be set on the connection. This is then configured via the Hibernate hibernate.connection.SQLINITSTRING property:

    cfg = new Configuration()
             .setProperty( "hibernate.connection.SQLINITSTRING", "SET TEMPORARY OPTION connection_authentication='Company=MyCo;Application=MyApp;Signature=0fa55159999e14d818e...'");
    

The JDBC URL is specified as usual.

  • SQL Anywhere JDBC: This is set via the InitString connection property on the JDBC URL:

    cfg = new Configuration()
             .setProperty( "hibernate.connection.url", "jdbc:sqlanywhere:UID=dba;PWD=sql;SERVER=demo;InitString=SET TEMPORARY OPTION connection_authentication='Company=MyCo;Application=MyApp;Signature=0fa55159999e14d818e...'");
    

These properties can also be set via the hibernate.cfg.xml file, as usual.

permanent link

answered 02 Aug '13, 08:02

Jeff%20Albion's gravatar image

Jeff Albion
10.7k171174
accept rate: 24%

edited 02 Aug '13, 08:11

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×22
×7

question asked: 02 Aug '13, 06:05

question was seen: 1,930 times

last updated: 02 Aug '13, 08:11