Skip to Main Content

Java Database Connectivity (JDBC)

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!

Java Oracle JDBC question: ResultSet.getString removing characters on return?

johnnysubwaySep 24 2014 — edited Oct 15 2014

I've never encountered this specific issue before, but it seems to happen when I call java.sql.ResultSet.getString(String columnName) on a column that represents a CITY name in an address table, if the string contains a "ss", as in the city name "Casselbury", the retrieved string looks like this: "Ca elbury". I don't know if this is a bug in either the Oracle JDBC driver or the Java SQL ResultSet, or if there's some other issue, but I'm at a loss to explain it! Anyone have any suggestions on how I can figure this out and/or correct the issue?

Thanks!

- Dave

This post has been answered by johnnysubway on Oct 2 2014
Jump to Answer

Comments

632857
P.S.: I am using jdk 1.5.0_13, Mac OS 10.5.2.
Gmfeinberg-Oracle
Hi,

The first thing to check is if you are setting DYLD_LIBRARY_PATH in your environment. Are you trying to run the examples? E.g. basic.HelloWorld?

Regards,
George
632857
Hi George,

I tried to run the example HelloWorld with this VM parameter:

-Djava.library.path=/Users/hvtranho/dbxml-2.4.11/install/lib

I got the same error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/hvtranho/dbxml-2.4.11/install/lib/libdbxml_java-2.4.jnilib:
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1739)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at com.sleepycat.dbxml.dbxml_javaJNI.<clinit>(dbxml_javaJNI.java:49)
at com.sleepycat.dbxml.XmlManager.<init>(XmlManager.java:96)
at com.sleepycat.dbxml.XmlManager.<init>(XmlManager.java:102)
at com.mytest.app.HelloWorld.main(HelloWorld.java:41)

Best Regards,
hvtranho.
Gmfeinberg-Oracle
hvtranho,

I don't think that using java.library.path alone is sufficient. Try setting DYLD_LIBRARY_PATH.

Regards,
George
632857
Hi George,

after setting that env variable:

export DYLD_LIBRARY_PATH=/Users/hvtranho/dbxml-2.4.11/install/lib

and restart my Mac, check again, run the app: I got the same error.

Thanks,
Hoan.
632857
Hi George,

only for info: If I switch to the old version of the DB (2.3.10), the HelloWorld run through.

Best Regards,
Hoan.
Gmfeinberg-Oracle
Hoan,

2.4 has been run on OS X 10.5. Are you sure your build was successful? Can you run C++ examples?

Regards,
George
Gmfeinberg-Oracle
Hoan,

One difference in Java from 2.3.10 to 2.4.x is adding explicit -source and -target directives to javac. I have no idea why that'd be a problem for you but it can't hurt to remove them - edit dbxml/build_unix/Makefile.defs and take them out of JAVACFLAGS

Then from that same directory, type:
rm dbxml.jar
make java
make install

You should see the javac happen in the first make.

Regards,
George
632857
Hi George,

thanks a lot, it works after I did following your instruction.

Best Regards,
Hoan.
705311
Dear George,

Thanks for this post. I had the same problem as Hoan's one.

However, according to your post, it works fine for me by doing a "make clean" between "rm dbxml.jar" and "make java".

Best regards,

Sébastien.
1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 30 2014
Added on Sep 24 2014
2 comments
406 views