Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Tuxedo Support for Unix odbc driver DB2

2664255Apr 30 2014 — edited May 27 2014

Hi,

We are developing linux based application which interacts with IBM DB2 and Web Sphere MQ. We are using XA transactions in this application.

We are planning to use tuxedo to do the two phase commit on both the database and on the queue manager. But for interacting with Database we want to use UNIX ODBC driver and as far as we have seen the samples of tuxedo we found no samples that use UNIX ODBC driver to connect with database, instead it uses Embedded SQL.

My question is whether Tuxedo supports UNIX odbc driver for interacting with Database or it has support for Embedded SQL?

Thanks,

Mandar

Comments

unknown-7404
Answer

Some body please guide me about this.

You continue to make it hard for people to 'guide' you when you don't follow their previous advise to first read the documentation or The Java Tutorials to learn how to use Java.

All of your questions can be EASILY answered just by reading the documentation or by reading the appropriate tutorial and trying the examples there.

You have to LEARN how to use Java BEFORE you try to write code that uses it.

This question is a good example.

I am trying to handle square root exception.

What 'exception' are you talking about? There IS NO EXCEPTION. If you read the Java API for the 'sqrt' function you would see that immediately.

https://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#sqrt(double)

public static double sqrt(double a)

Returns the correctly rounded positive square root of a double value. Special cases:

  • If the argument is NaN or less than zero, then the result is NaN.
  • If the argument is positive infinity, then the result is positive infinity.
  • If the argument is positive zero or negative zero, then the result is the same as the argument.

Otherwise, the result is the double value closest to the true mathematical square root of the argument value.

Parameters:
a - a value.
Returns:
the positive square root of a. If the argument is NaN or less than zero, the result is NaN.

Do you see any 'exception' shown in the above doc API description?

For instance if the argument is positive (i.e. 25) , it displays its result (i.e. 5) in the text area but if the argument is negative it displays "NaN" in the text area instead of "Square root of negative numbers not possible" .

Of course it displays "NaN" - that is EXACTLY what you told it to display:

double res= Math.sqrt(val);

taResult.setText(" " + res);

That says do the square root and display the result no matter what that result is. If the result is NaN then display it. If the result is NOT NaN then display it.

So Java did just what you told it.

You did NOT say 'check the result and if it is NaN display some message instead.

}catch(ArithmeticException e){

taResult.setText("Square root of negative numbers not possible");

}

Do you see any 'ArithmeticException' listed in the doc API quote I provided above?

Do you see where the doc says that the result can be NaN?

You will continue to have problems with Java, and everything else, until you learn how to use Java.

The easiest way to do that is to use The Java Tutorials and the Java API docs.

Let those docs 'guide' you. Then if you have SPECIFIC questions about what those docs say or about one of the trail examples post your question and ask it.

Marked as Answer by Zulfi Khan · Sep 27 2020
Zulfi Khan

Hi,

My friend thanks for your explanation regarding NaN. Actually I never believe to get NaN for taking square root of negative value. Because this is mathematics & NaN is not part of mathemetics. God bless you for your time.

However my learning policy does not depend only on reading documents. I dont hesitate to knock any door for seeking knowledge.

Zulfi.

unknown-7404

Actually I never believe to get NaN for taking square root of negative value.

The Java API, which I showed you, tells you you can get NaN and that you won't get an exception for your use case.

The Java API for any class or method is EASILY available in NetBeans just by a right-click and selecting to view the Java Doc.

And for someone that doesn't know what NaN all you need to do is a simple web search for 'mathematics nan' and the wiki is one of the links

https://en.wikipedia.org/wiki/NaN

In computing, NaN, standing for not a number, is a numeric data type value representing an undefined or unrepresentable value, especially in floating-point calculations. Systematic use of NaNs was introduced by the IEEE 754 floating-point standard in 1985, along with the representation of other non-finite quantities like infinities.

See where NaN has been a standard since 1985?

However my learning policy does not depend only on reading documents. I dont hesitate to knock any door for seeking knowledge.

No one should 'depend only' on reading documents.

But you should ALWAYS include reading documents as the first steps towards learning something.

I'm just trying to show you, and others, that the docs usually have the answers to the common questions about the basics.

1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 24 2014
Added on Apr 30 2014
3 comments
1,728 views