Java math library?

Hi all,
Does anyone know a java math-library which provides analysis stuff?
I'd like to generate a function (approximation) which describes a curve.
What I need is an implementation of Lagrange interpolation formula or
Newton interpolation formula.
Google lets me down. Any help would be greatly appreciated!

You could try looking through the list of stuff at http://math.nist.gov/javanumerics/

Similar Messages

  • ADF: JBO-25009: Cannot create an object of type:java.math.Bi. Jdev 11.1.2.3

    Hi,
    I have created a tree structure on the left side of the page and a table on the right hand of the page. My requirement is that when I click on the node on the left side, the table on the right needs to be refreshed. For the time being the tree nodes on the left side is just one level. Eveytime I click on the node, I get the following error
    <RichExceptionHandler> <_logUnhandledException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
    javax.el.ELException: oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:java.math.BigDecimal from type:java.lang.String with value:Restricted
    at com.sun.el.parser.AstValue.invoke(Unknown Source)
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1589)
    at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:237)
    at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:308)
    at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:157)
    at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:244)
    at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:308)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:java.math.BigDecimal from type:java.lang.String with value:Restricted
    at oracle.jbo.common.JboTypeMapEntries$2.convert(JboTypeMapEntries.java:135)
    at oracle.jbo.domain.TypeFactory.get(TypeFactory.java:869)
    at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:116)
    at oracle.jbo.server.AttributeDefImpl.convertToJava(AttributeDefImpl.java:2220)
    at oracle.jbo.server.ViewRowSetImpl.prepKeyForFind(ViewRowSetImpl.java:5377)
    at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:5394)
    at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:5296)
    at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:5290)
    at oracle.jbo.server.ViewObjectImpl.findByKey(ViewObjectImpl.java:11628)
    at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.syncTargetIter(JUCtrlHierNodeBinding.java:641)
    at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.internalSetCurrentRow(JUCtrlHierNodeBinding.java:617)
    at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.syncCurrentRow(JUCtrlHierNodeBinding.java:547)
    at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.setRowAsCurrentOnTargetIterator(JUCtrlHierNodeBinding.java:561)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierNodeBinding.setRowAsCurrentOnTargetIterator(FacesCtrlHierNodeBinding.java:147)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.makeCurrent(FacesCtrlHierBinding.java:685)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    ... 58 more
    Caused by: java.lang.NumberFormatException
    at java.math.BigDecimal.<init>(BigDecimal.java:459)
    at java.math.BigDecimal.<init>(BigDecimal.java:728)
    at oracle.jbo.common.JboTypeMapEntries$2.convert(JboTypeMapEntries.java:129)
    ... 76 more
    Please can you let me know how I can resolve this issue.
    Thanks

    Hi, I have rechecked this issue. In the bug they say that Big Integer should be changed to Big Decimal to resolve the issue. I checked my application and saw that there is no Big Interger. Please can you guide me further.

  • Can fdlibm (native math library) be replaced?

    Looking at the jdk1.4.1 source code java.lang.Math class delegates most of its calls to java.lang.StrictMath. According to the documentation, the native calls in StrictMath are done in fdlibm. Does anyone know where/how fdlibm is loaded? Is this library accessed via JNI or some other jvm-specific mechanism? The reason why I am asking this is because I would like to replace fdlibm by a different (much faster) math library without incurring JNI method call overhead. Is this possible or am I stuck using my own native math library accessed via JNI? On my system, using the system native math library (libm), the time required to calculate sin(x) is about the same as the JNI method call overhead?
    Thanks,
    Dale

    Just because the source for java.lang.Math appears to delegate the calculation to StrictMath, doesn't mean that the JVM actually does this. It can easily replace these methods with something else provided that the specification is observed. It is clear from timing the calls that Math.sin is faster than StrictMath.sin although still significantly slower than the Intel FSIN instruction. The Math code appears to be reducing the argument range to +-PI/4 using the technique used in fdlibm and then using FSIN on this reduced range.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Math library not generating errno values or SIGFPE on Intel!!

    Hello. I posted this a long while back and got no responses, so I decided to ask again. I am writing a calculator, and it is not very nice for testing if I have to wind up with this:
    <pre style="width: 600px; background-color: #F0F0F0">$ hoc
    sqrt(-4)
    nan
    atan2(0,0)
    0
    pow(-4, 1/2)
    nan
    1e4000 * 1e4000
    inf
    (-1e4000) * (1e40000)
    -inf
    1e-40000
    0
    </pre>
    My program handles SIGFPE and there is a function errcheck() that checks the value of errno. It seems like the atan2(), pow(), and sqrt() functions do not assign to errno like they should. I'm running on an Intel Mac, and it makes making sure this calculator works right a big pain. Does anyone PLEASE know how to fix this? THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    What x-bc does is: convert long function names (sin(), ...) to the short ones (s(), ...), save the final result in a temporary file, and just pipe bc -lq (include math library, no GNU bc banner) redirecting standard input to that temporary file over to their GTK+ text box. There's something that has to do with GNU bc then, and that results in a weird value (1) in my testing...
    PS - The file is src/main_window.cc; function int main_window::executeBc() - on version 2.0: lines 376 through 408. The code that does converting long to short is unknown to me.
    Message was edited by: andlabs
    Message was edited by: andlabs

  • Set image path in java class library

    Hi,
    I created a java class library project and made .jar file. My java class library contains .jpg files in separete folder named as Images. My .jar file contains list of classes and image folder also but when i am using .jar file in applet. java class library is working but images are not shown. Let me know how to create imageicon to show images also in the class library

    ImageIcon icon = new ImageIcon(getClass().getResource(path-to-file));

  • JGSL : about java scientific library, how to use it any tutorial or etc

    Hay,
    I have a question regarding JGSL: java scientific library.
    I just download the jgsl.0.1.1 lib for my project
    It contains a bunch of file, including the lib files
    I set the lib folder path in the LD_LIBRARY_PATH and when i tried to run the testfile.class
    that comes with this library, i got an error
    main class defination not found.
    Have any one used the lib if yes can send me the working example.
    or at least tell me how to set these things, there is no documentation available with this.
    thanks

    Why don't u use a class loader. Try this code
    // loader class
    public class Loader  extends ClassLoader {
        String path;
        public Loader(String path) {
              this.path = path;
        public Class findClass(String name) {
            byte[] b = loadClassData(path+name+".class");
            return defineClass(name, b, 0, b.length);
        private byte[] loadClassData(String name) {
            File file = new File(name);
            byte[] data = null;
            try {
                InputStream in = new FileInputStream(file);
                data = new byte[ (int) file.length()];
                for (int i = 0; i < data.length; i++) {
                    data[i] = (byte) in.read();
            catch (IOException ex) {
            file = null;
            return data;
    // in your caller class use
       Loader loader = new Loader(libPath); // lib path may be taken from a command line arg
       Object main = loader.loadClass("ClassLib", true).newInstance();I think this is what u r looking for
    Uditha Nagahawatta

  • Cast to a literal (ex. "java.math.BigDecimal")

    I have an array with 2 columns like:
    "java.math.BigDecimal", "2"
    "java.lang.String", "Test 01"
    "java.math.BigDecimal","120"
    "java.math.BigDecimal","148"
    "java.lang.String", "Test 02"
    Is there way to cast the second string to the correct object type, using the first string.
    Something like this:
    ("java.math.BigDecimal")("2")
    ("java.lang.String")("Test 01")
    thanks in advance,
    intovoid

    You could do this by reflection for classes which
    have a contructor which takes an single string
    parameter - which I believe all these classes do.
    Lot's of messy expections to field. The sequence
    would be something like:
    private static Object create(String[] columns) throws
    Exception {
    Class clazz = Class.forName(columns[0]);  // get
    the class
    Contstructor cons = clazz.getConstructor(new
    Class[]{String.class}); // get constructor from
    String
    return cons.newInstance(new Object[]{columns[1]});
    // construct object
    code]Except, the problem remains that the OP can still not cast the Object returned by newInstance() by using the String in columns[0] (even though the Object is a BigDecimal). Even if it could be cast "dynamically", what would it be cast into - you can not dynamically declare the variable type.
    The above method could work if all the possible objects returned implemented a common interface. Or maybe instanceof could be used to hard-code the cast to the possible objects.
    In the end, I think this type of code can lead to a brittle design.

  • Problem with the math library functions

    Hi,
    I encountered a problem related to some functions provided by math library on sun. I narrowed it down to the following test program:
    ========================================================
    #include<stdio.h>
    #include<math.h>
    void pow_res()
    double x = 10.0;
    double y = 2.5;
    printf("pow(%.2e, %.2e):%.20e\n", x, y, pow(10.0, 2.5));
    void cos_res()
    double x = -6.433230338433114370e-02;
    printf("x:%.20e cos(x):%.20e\n", x, cos(x));
    int main()
    pow_res();
    cos_res();
    return 0;
    ========================================================
    The above test program has to be linked with any math library. It is �libm� for amd64/linux, but for sparc we have choice between �libm� and �libmopt�. I am compiling above program with "cc <test_program.c> <-lm/-lmopt>" command.
    On sparc, if the above test program is getting linked with �-lm" then it gives same results for the �cos� on both amd64 and sparc, but gives different results (16th decimal digit onward) for �pow�. If it is getting linked with �-lmopt� then it gives same result for the �pow� on both the platforms, but gives different results for �cos�. Linux results match with the amd64 results.
    The �Numerical Computation Guide� provided by SUN (ftp://docs-pdf.sun.com/802-5692/802-5692.pdf page 40, table 2.10 ) says that you can trust only 15-17 decimal digits for double calculation. But here the requirement is to match the sparc results exactly with the amd64/linux or at least match the result till 20th decimal digit. I guess it is something to do with the FPU setting either through compiler options or code. I tried many different compiler options, like -fast, different combinations of compiler options provided by -fast macro, but nothing helped.
    Following is the system configuration:
    Amd64:
    gcc version: 3.3.6
    OS: RedHat Enterprise Linux 3.0 U7 (Linux 2.4.21-40.ELsmp x86_64)
    Sparc:
    cc version: Sun C 5.8 Patch 121015-01
    OS: SunOS 5.9 Generic_118558-21 sun4u sparc SUNW,Sun-Fire-280R
    It will be great if somebody can explain the problem and the solution to get rid of it.
    Many thanks,
    Sunil

    Transcendental functions are not specified to be correctly rounded in the same
    sense as +-*/.     So it's entirely possible, and often observed, that libraries of equal
    quality deliver slightly different results.
    To simplify, suppose one wanted to compute x = 4*atan(1.0)
    which happens to be the
    transcendental number pi which is roughly, in hex and in decimali:
    .C90F DAA2 2168 C234 C... * 2^4 or 3.141592653589793239...
    But binary floating-point arithmetic can only represent certain rational numbers of
    the form of an integer of at most 53 significant bits times a power of two. The
    nearest double-precision number to pi is
    .C90F DAA2 2168 C * 2^4 or roughly 3.141592653589793116...
    This particular number has a large but finite decimal expansion. And if you
    do printf with %e.20 you will get the 20 decimal digits of that double-precision
    number's expansion, not the 20 decimal digits of pi, which only agrees to the
    15 significant decimals 3.141592653589793 and differs afterward.
    In the case of pow(10.0,2.5), (which happens to be sqrt(1.0e5))
    the correct result in hex looks something like
    .9E1D 276F D4BA C410 C... * 2^9 or roughly 3.162277660168379332...E+2
    in hex notation, while the closest double precision number is
    .9E1D 276F D4BA C8 * 2^9 or roughly 3.162277660168379612...E+2
    but it's only slightly closer than the next closest double precision number
    .9E1D 276F D4BA c0 *2^9 or roughly 3.162277660168379043...E+2
    Either answer is a good answer, and math libraries might that only aspire to
    deliver results that are close to correctly rounded might deliver either, depending
    on which approximation algorithm is used, which might depend on what's fastest
    on a particular processor.
    So why don't math libraries deliver correctly rounded results instead of almost?
    Because the slight extra increase in accuracy doesn't do much good for most
    people, and the major decrease in performance is noticeable by lots of people.
    The main payoff of correctly rounded transcendental functions is that they
    promote uniform numerical results across platforms, which is worth something
    to some people but not much to many people.
    So for those who find it worthwhile, there are correctly rounded transcendental
    function libraries available. Sun's development version is available at
    http://www.sun.com/download/products.xml?id=41797765
    Another solution for some people is to change double variables and functions
    to long double, using powl and cosl in the examples. That increases the
    accuracy to almost 20 digits on x86 and over 30 digits on SPARC, and while
    the same issues eventually arise, most users would never encounter them.
    The SPARC long double implementation is in software rather than hardware,
    and so entails a major performance reduction compared to double.
    The Numerical Computation Guide at docs.sun.com discusses many of these
    issues at greater length.

  • Java.math package does not exist!!!

    hi java experts, i really desperately need some help. ihave been trying to compile a java program i have written that imports the java.math package as i am using the BigInteger class. I am using SUN ONE STUDIO ME 4 and have j2se SDk installed. when i try to build the program in the IDE, it gives me an error message saying the java.math package does not exist. i can't understand why. i think it's an IDE problem. i tried mounting the filesystem and i mounted almost a million times in diff ways but it still can't compile. i can't find the directory of the java.math to mount into. anyway i tried to compile it at the command prompt and it can compile but with errors... so i figure that i do have the java.math class on my system just that the IDE jsut can't recognise it. i am at my wits end and gonna go mad if someone doesn't please help me.
    adeline from singapore

    Cross-posted at http://forum.java.sun.com/thread.jsp?thread=293132&forum=54&message=1155073

  • Package java.math does not exist!!!

    hi java experts, i really desperately need some help. ihave been trying to compile a java program i have written that imports the java.math package as i am using the BigInteger class. I am using SUN ONE STUDIO ME 4 and have j2se SDk installed. when i try to build the program in the IDE, it gives me an error message saying the java.math package does not exist. i can't understand why. i think it's an IDE problem. i tried mounting the filesystem and i mounted almost a million times in diff ways but it still can't compile. i can't find the directory of the java.math to mount into. anyway i tried to compile it at the command prompt and it can compile but with errors... so i figure that i do have the java.math class on my system just that the IDE jsut can't recognise it. i am at my wits end and gonna go mad if someone doesn't please help me.
    adeline from singapore

    java.math package will be there in jdk_dir\jre\lib\rt.jar. You need to set the classpath variable in your IDE for this jar file. There must be some means to edit the IDE's classpath variable.
    i mounted almost a million times in diff ways but it still can't compileIf it takes one minute for each mount then total time you have taken = 10000000 minutes = 166666 hours = 6944 days = 19 years (roughly). Java was not there 19 years ago.
    Sudha

  • Java SSF library

    We are trying to use SSF ( digital signatures ) as authentication mechanism for Archive Link through HTTP Interface.ABAP code is generating PKCS#7 signed URL and we want to verify it using Java SSF library in an external system.SAP documentation talks about JAVA IAIK toolkit can be downloded from Service market place. I can't find it on service.sap.com. Does anybody know where can I download JAVA SSF from ?
    cheers
    Ramesh.

    Hi Aldo,
    The java packages where this classes and interfaces are implemented are:
    - com.sap.security.api.ssf
    - com.sap.security.core.server.ssf
    You can find this in the jar file tc_sec_ssf.jar.
    Also look the following SAP Help link [Secure Store and Forward Mechanism (SSF)|http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/bf6f77a2c5446a86e0152f1b309db6/frameset.htm]
    Please reward if helpful.
    Regards
    Alexandre

  • Java class library method definition is visible in debugging!!!!!

    I create a jar by using java class library project option, and when i am using it in other project, it is displaying all code inside the library, i implement security inside the java library, it contains some key ...... is there any way to hide the code? or how to hide my logic when i submit it to client...
    is there any tool for this or is there are any technique to create a dll like microsoft supply.

    rohit pathak wrote:
    thanks for your time gimbal2 ,
    I tested it and it is working fine, i choose the option
    Exclude from jar file - **/*.java
    and its worked out.could you tell me about security of this class library (.jar file) ? Although i used required code { code which omit .java file during packaging } , is this is secure? or we can get the code { key in my case } from .jar file by any java tool.As you have already noticed through your other thread - yes you can.
    how to secure code in java..

  • Java Class Library

    What's the online Java Class Library reference site?
    I swore it was on this Java.sun.com site, but I can't seem to locate it again.
    Thanks,
    MB

    Are you looking for http://java.sun.com/j2se/1.3/docs/api/index.html by any chance ?

  • Adding two java.math.BigDecimal values

    Hi,
    I want to add two java.math.BigDecimal values (like a + b).
    This code returns only the a value
    java.math.BigDecimal a = new java.math.BigDecimal(0);
    java.math.BigDecimal a = new java.math.BigDecimal(23);
    a.add(b);How can I add these values?
    Thanks
    Jonny

    For your kind information, the code does not return any value. You are supposed to save the return value from the add() function call. Something like this:
    java.math.BigDecimal c = a.add(b);
    // print the value of c here

  • NUMBER - java.math.BigDecimal

    Dear JDBC writer,
    When I have done a query in my Java program on a table in an Oracle database with a NUMBER or NUMBER(4) or NUMBER(4,2) column,
    and I use the generic method ResultSet.getObject(int column), the method always returns a java.math.BigDecimal instance.
    1. In case of NUMBER(4) I had suspected a java.lang.Integer instance. In case of NUMBER I had suspected a java.lang.Double instance. Why did you return a java.math.BigDecimal instance?
    2. Was it your intention to do further calculations with the BigDecimal instance or should I check the precision and scale of the column and get the int or double out of the BigDecimal instance?

    Thanks for the tip about getNUMBER, that may help with some of my other problems, but I'm trying to get data out of oracle spatial geometry types, and both integers and floats are stored in arrays of numbers. If you do a getarray on these or even process them as a result set, you get bigdecimals. How could I do the equivalent of getNUMBER for an array type? This is a huge performance problem for Oracle spatial and java.

Maybe you are looking for

  • Daylight time under vista

    When ich use this code and the operating system setting "Automatically adjust clock for daylight saving changes" is checked with GMT+1, i will get with Windows Vista and Windows XP several results: public class TestDate         public static void mai

  • Convert varchar(255) to varchar(50)

    I want to transfer data from a staging table to another table. The staging table has columns with datatypes I don't always want, and I'm converting them like so: INSERT INTO [dbo].[my_table] SELECT CONVERT(datetime,TimeIndex,103), CONVERT(decimal(6,3

  • Servelet not loaded

    I have inherited a web site and I am trying to understand the structure. I built a 9iAS Rel 3 "test" web server and deployed the app to the server. The home page works fine and my first link to a required login page loads just fine. After entering th

  • Cannot Purchase Photobook -- Error Message

    I see that there is a similar post below. I posted to that thread but in case it's not seen I wanted to post it again. My error message: Your book seems to have frames on one or more pages that do not contain photos. You must either change the layout

  • Aperture cannot locate master files when upgrading to new OS X Leopard

    I have recently upgraded to Leopard from Tiger. The problem I have encountered is that when trying to locate the master files of my pictures, Aperture cannot because it thinks my files are in my hard drive located in my previous OS X and that the vol