Problem accessing VARRAY OF VARCHAR in 9i, but working in 8i

The following code (modified sample ArrayExample.java for VARRAY
OF VARCHAR) produces different results on a 8.1.7 and 9.0.1
database. The standard way of accessing the members of an array
of strings in the database:
ARRAY array = ((OracleResultSet)rs).getARRAY (1);
// get Array elements
String[] values = (String[]) array.getArray();
for (int i=0; i<values.length; i++)
System.out.println(">> index "+i+" = "+values);
seems not to work for strings in 9i. Instead it prints the byte
representation of the strings ("0x313233" instead of "123").
Code below shows, that using a workaround it is possible to
access the string itself.
Results of code below (always using the 9i JDBC driver).
8i (correct):
Row 1 :
Array is of type SDMC_FS.STR_VARRAY
Array element is of type code 12
Array is of length 2
index 0 = 123 =?= 123
index 1 = 456 =?= 4569i (incorrect):
Row 1 :
Array is of type SDMC_FS.STR_VARRAY
Array element is of type code 12
Array is of length 2
index 0 = 123 =?= 0x313233
index 1 = 456 =?= 0x343536Whats wrong?
br Thomas Spaarmann
import java.sql.*;
import oracle.sql.*;
import oracle.jdbc.oracore.Util;
import oracle.jdbc.*;
import java.math.BigDecimal;
public class ArrayExample
public static void main (String args[])
throws Exception
// Register the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
// The sample retrieves an varray of type "NUM_VARRAY",
// materializes the object as an object of type ARRAY.
// A new ARRAY is then inserted into the database.
String url = "jdbc:oracle:oci8:@";
try {
String url1 = System.getProperty("JDBC_URL");
if (url1 != null)
url = url1;
} catch (Exception e) {
// If there is any security exception, ignore it
// and use the default
// Connect to the database
Connection conn =
DriverManager.getConnection (url, "scott", "tiger");
// It's faster when auto commit is off
conn.setAutoCommit (false);
// Create a Statement
Statement stmt = conn.createStatement ();
try
stmt.execute ("DROP TABLE varray_table");
stmt.execute ("DROP TYPE str_varray");
catch (SQLException e)
// the above drop statements will throw exceptions
// if the types and tables did not exist before. Just
ingore it.
stmt.execute ("CREATE TYPE str_varray AS VARRAY(10) OF
VARCHAR(256)");
stmt.execute ("CREATE TABLE varray_table (col1 str_varray)");
stmt.execute ("INSERT INTO varray_table VALUES
(str_varray('123', '456'))");
ResultSet rs = stmt.executeQuery("SELECT * FROM
varray_table");
showResultSet (rs);
rs.close();
stmt.close();
conn.close();
public static void showResultSet (ResultSet rs)
throws SQLException
int line = 0;
while (rs.next())
line++;
System.out.println("Row "+line+" : ");
ARRAY array = ((OracleResultSet)rs).getARRAY (1);
System.out.println ("Array is of type
"+array.getSQLTypeName());
System.out.println ("Array element is of type code
"+array.getBaseType());
System.out.println ("Array is of length "+array.length());
// get Array elements
Datum[] values = (Datum[]) array.getOracleArray();
String[] strValues = (String[]) array.getArray();
for (int i=0; i<values.length; i++)
String value = new String( values[i].getBytes());
System.out.println(">> index "+i+" = "+value+" =?=
"+strValues[i]);

Are you including nls_charset11.zip (or nls_charset12.zip) in
your CLASSPATH?
Whenever a conversion into (or out of) a particular character set
fails you may see a hex representation instead. By default the
JDBC driver classes111/12 do not include the conversions
required for the Windows character set.

Similar Messages

  • Problem accessing resources in a built jar but works fine within eclipse

    Howdy,
    I have an image which I am trying to set as my jframe icon, quick overview:
    package: testpackage
    source directory: src (in root dir of package)
    image directory: icon (in root dir of package)
    So if i do this to aquire the image, within the IDE it works fine!
    Image image = Toolkit.getDefaultToolkit().getImage("icon/test.png");
    However, if I export the jar file and try to run it, the image is not being found. I used jar xf to open the jar file and the relitive path is still the same "icon/test.png"...ive tried everything I can think of including just trying to move/include the image file in my source directory but no luck
    FWIW when i right click on the image within eclipse and select "copy fully qualified name" i get a path like this:
    /project/src/package/icon/test.png
    Any ideas?
    thanks

    Try
    Image image = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/icon/test.png"));

  • Problems Accessing VARRAY from Java

    Hi,
    I am calling a stored procedure with IN parameters as VARRAYS from Java application.
    There are two schemas in the database. One main schema, say 'MAIN_SCHEMA' which contains all the table,VARRAYS,packages etc. There are public synonyms for all the database object including VARRAYS in this schema. The java application uses a connection pool created using another user say 'ADMIN'. This user has been granted priviliges for acccessing all the objects in the 'MAIN_SCHEMA'. For the VARRAYS we have created public synonyms and granted EXECUTE for ADMIN.
    However when I try to execute the stored procedure from java , I get an SQLException("invalid name pattern: ADMIN.UIDARRAY")
    I solved the problem temporarily by prefixing the main schema name to the name of the VARRAY. The sample code I have used is as below. but I am not sure if this is the correct way of doing it. I do not understand why we have to prefix the schema name if we have priviliges and public synonyms on the object.
    public void setPendingForfeituresUids(java.util.List pendingForfeituresUids) throws DAOException{
    try{
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(
    "MAIN_SCHEMA.UIDARRAY", con);
    array = new ARRAY(descriptor, con, pendingForfeituresUids.toArray());
    if(array == null){
    stmt.setNull(3,java.sql.Types.ARRAY);
    }else{
    stmt.setArray(3, array);
    }catch(SQLException e){
    closeStatement();
    releaseLobWrappers();
    throw new DAOException(e);
    Database and Drivers used
    I am using Oracle 9.2.0.1.0, Weblogic 8.1, Oracle Jdbc thin driver for 9.2 that comes bundled with weblogic (ojdbc14.jar)
    Any help on this is welcome.
    Thanks,
    Sunil

    Hi Sunil,
    I was wondering if you had any solution to the problem you listed.
    We are also facing a similar problem and is reported to oracle. Its a Bug as per oracle.
    Any help in getting this resolved is appreciated.
    Thanks,
    Sandip
    [email protected]

  • 3G network problems in DC: cannot connect to internet, but works with EDGE

    I can load web pages fine when I turn off 3G in the settings tab (and use only EDGE), but when I turn on 3G I need to "reload" the page several times before it will load.
    This is really annoying because it is clearly a AT&T 3G network problem. After spending about an hour on the phone troubleshooting the problem with Apple-iphone and ATT "customer support", they concluded that although I was having a problem, because ATT does not show a current issue in the Washington, DC area, there is nothing they can do.
    Argh! ATT and Apple need to work things out to fix the network problems, I hate being caught in the middle of their animus relationship.
    I guess I will have to continue paying for a service that is spotty, because as the ATT representative pointed out, they do not guarantee any service and will not recompense for any alleged outage.
    Wow, now that is a prime example of why having no effective competition in cellular providers means the customer loses.

    I appears to me that the problem is not related to whether you are on the phone or not. Generally, it seems like there is a problem with the 3G network being EXTREMELY slow and non-responsive. When I press the reload button several times, sometimes is loads very quickly as I would expect on 3G.
    Still having this problem today.

  • HELP! Problem accessing usb hard drive on airport extreme

    Hi all,
    Hopefully someone can help me.
    I have a Macbook Pro (2009).  Recently put on Lion and have had no problems until now.   Last night, the computer could not see the USB HD that is plugged into our Airport Extreme that it was using for the time machine backups.  HOWEVER, our Macbook (white 2007) which is also running Lion has no problems accessing the HD! The Airport is working fine as we can still access email, the internet and my NAS drive (D-link 323).
    So, I went into the Airport utility and clicked on the Drive section... the drive is shown on the airport and the settings are all set for sharing (etc. etc.)... but in finder I cannot access any of the drives on the airport... I just get a "Connection Failed" and then a pop-up saying that there was an error connecting to the airport, check the address and if the problem persists check with the admin.
    This is what I have done so far....
    1. Rebooted the airport (using Airport utility)... didn't work.
    2. Turned off the USB HD and turned it back on.... didn't work.
    3. Verified and fixed the permissions on the macbook pro... didn't work.
    4. Turned everything off and then restarted everything again... didn't work.
    5. Compared all the settings on our macbook for the Airport extreeme (using the airport utility) and the macbook pro... everything was identical nothing needed to be changed.
    6. Tried to connect to our macbook using the macbook pro... came up with a "Connection Failed"... HOWEVER I was able to share the screen?!?!?!?!?
    7.  I pinged the airport... no problems pining...its only has problems connecting to the drives on the airport.
    The airport is shown under the "shared" section of finder along with my NAS dirve (D-link 323) and the macbook... I can access the D-link with no issues but nothing else. 
    Please help... this is very frustrating and It dosnt make sence as to why it can see the drive but wont let me access it.
    Thanks!

    A little update... spoke to Apple Care... they said that this happens and then are aware that this happens, but had no answers how to fix.
    Unfortunately not much help... anyone else have any information?
    Please help!

  • Flex does not auto load in Firefox and Opera but works in IE

    I am using the following wrapper for deploying my Flex application. It works fine when the files are local but when the files are deployed on the server, IE works fine but I only see a blank screen in firefox and opera. However if I right click and click play the application runs fine. I don't understand what I need to do to make the Flex application autorun in Firefox and Opera as it works on IE (on server and local) and all browsers (when local).
    I would be grateful for any help. I am wantonly including flashVars in both the object and embed tags to get it to be read in all browsers. The problem seems to be play="true" does not seems to be honored in Firefox and Opera when the flash in on a server but works when it is local. I have also tried accessing the flash directly without a HTML wrapper but the same problem happens only in firefox and opera but works in IE.
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
               id="DistributorWarehouse" width="100%" height="100%"
       codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
       <param name="movie" value="/public/DISTRIBUTORWAREHOUSE.SWF" />
       <param name="quality" value="high" />
       <param name="bgcolor" value="#869ca7" />
       <param name="allowScriptAccess" value="sameDomain" />
       <param name="flashVars" value="CustNo=0000000004&Distp=2&Distfl=4&Distsl=0020&vkorg=GDMI&vtweg=CM&empl=X"/>
       <embed src="/public/DISTRIBUTORWAREHOUSE.SWF" bgcolor="#869ca7"
        width="100%" height="100%" name="DistributorWarehouse" align="middle"
        play="true"
        loop="false"
        quality="high"
        flashVars="CustNo=0000000004&Distp=2&Distfl=4&Distsl=0020&vkorg=GDMI&vtweg=CM&empl=X"
        allowScriptAccess="sameDomain"
        type="application/x-shockwave-flash"
        pluginspage="http://www.adobe.com/go/getflashplayer">
       </embed>
    </object>

    I found the cause of the problem. The server was compressing the swf file to reduce bandwidth and setting Content-Encoding: gzip. This means that Firefox and Opera receive the file but you have to right and click play to play the file or do a refresh. The solution is to change the server settings not to compress swf files. However I cannot understand why it should work in IE but not firefox or opera.

  • Superdrive no longer recognizes CD, but works fine with DVD

    my Superdrive seems to have a problem recognizing any type of CD media, but works fine with DVD media.
    I reinstalled Leopard and still the same problem. I also zapped the NVRAM (this is an Intel 2.0 Ghz Mac Mini w/ 2 GB Ram.
    Is there anything else I can do or do I just need to replace the drive?

    Typically when this sort of symptom appears, it relates to a hardware failure, either due to a faulty lens, or dirt. You might try a lens cleaner to ensure it is not the latter.
    Since this is a 2.0GHz mini, it ought to be still under warranty - if that is the case it would be wise to have Apple, or an approved service provider, check it and undertake any necessary repairs.

  • My iPad asks for my iCloud password but I can not. that I can do? the problem is that I try to access it by putting my email but I do not remember which was which I put.

    my iPad asks for my iCloud password but I can not. that I can do? the problem is that I try to access it by putting my email but I do not remember which was which I put.

    If the old ID is yours, and if your current ID was created by editing the details of this old ID (rather than being an entirely new ID), go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • Hello, I'll try to explain my problem (not that you did not understand, but my explanations may be long and difficult). I'm Lion 10.7.3 on iMac and I use Mail as my mail manager. My ISP (access , mails) is "VOO". At mail I am often "over quota" because th

    Hello,
    I'll try to explain my problem (not that you did not understand, but my explanations may be long and difficult).
    I'm Lion 10.7.3 on iMac and I use Mail as my mail manager.
    My ISP (access , mails) is "VOO".
    At mail I am often "over quota" because the server VOO grants only 40M. I would like to address this problem. I contacted VOO but they tell me not to know and do not appear to increase capacity at the moment.
    My idea was:
    - All messages received at the server VOO would be automatically transferred to another address (eg ................. @me.com, my address icloud) whose capacity is much greater.
    - But the problem is that nothing is planned at the server level VOO to perform this maneuver!
    - Therefore, I turn to you to ask yourself the question, one of you has it you an idea, a suggestion, a solution?
    Any suggestion is welcome.
    Thank you in advance for taking the trouble to read and possibly to follow up my request.
    How do I ask to go and read icloud (permanently) my mail to another address, that of my server?
    Philippe (philippe.thiriet @ me.com)

    Thank you for your reply and the clarification it brings me.
    Voo is imap of course and does not provide the possibility of forwarder mails to another address.
    Since I use MAIL and I receive messages without any problems sent to me on my address icloud (............... @me.com) I think to ask all in my address book to send me on my address on icloud. Is it a good idea?
    Could you tell me how much space I have in icloud? 40M is the highest in VOO.
    Thank you for your help and for the time you devote to my problem.
    Philippe

  • With my iPhone 3GS and iOS 6 no problem a home with my WLAN. But now with my new iPhone 5 and iOS 6 no access to my WLAN at home. What can I do?

    With my old iPhone 3GS and iOS 6 no problem a home with my WLAN. But now with my brand new iPhone 5 and iOS 6 no access to my WLAN at home. What can I do?

    check to see if there is a firmware update for your router. There are also lots of troubleshooting steps you can take in this article
    http://support.apple.com/kb/TS1398

  • Just wondering if anyone has a problem with accessing iTunes store. have iTunes installed but can't bring up the store home page?

    Just wondering if anyone has a problem with accessing iTunes store. have iTunes installed but can't bring up the store home page?

    i have the same problem! Safari won't work either. Can anyone help please? I have completely restored my computer trying to fix this and it still won't work! I have a 2 month old alienware laptop running windows 7

  • Having problems accessing any apps on my iCloud. Set up and signed in successfully but then when I click on an app it just says there's a problem but doesn't say how to fix it. Please help, am very new to this!

    Hi
    I am very new to updating my iPod touch and this is the first time I've used the iCloud. However, I am having problems accessing any apps on my iCloud such as photos, reminders etc. I've set it up on my iPod touch successfully and I can sign in on my PC. However, when I try to access any of the apps it says there was a problem. It doesn't tell me how to fix it or what the problem is.
    Is anyone able to help?

    It is working now. I no longer get the message about the item not being available in the US and I can access the store.

  • Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default

    in use:
    vRO 5.1
    eclipse 3.7.2
    vRo plug-sdk 5.1
    steps:
    1.create a plug-in project from samples(choose solar system)
    2.find the dar package and upload it by vRo configuration
    3.vRo configuration said upload successfully,but the solar system configuration is not properly configued..
    problem:
    Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default
    How to solve it??
    Thanks so much!!

    There was problem from crm side...its working now..

  • Mac won't update software or access iTunes shop. Message comes up with 'not connected to the net. Check connections' error. I still have internet access. Changed my Apple ID but no result. Repaired permissions and re-installed operating system.

    Mac won't update software or access iTunes shop. Message comes up with 'not connected to the net. Check connections' error. I still have internet access. Changed my Apple ID but no result. Repaired permissions and re-installed operating system.

    It sounds like you may have multiple problems, but none of them are likely to be caused by malware.
    First, the internet-related issues may be related to adware or a network compromise. I tend to lean more towards the latter, based on your description of the problem. See:
    http://www.adwaremedic.com/kb/baddns.php
    http://www.adwaremedic.com/kb/hackedrouter.php
    If investigation shows that this is not a network-specific issue, then it's probably adware. See my Adware Removal Guide for help finding and removing it. Note that you mention AdBlock as if it should have prevented this, but it's important to understand that ad blockers do not protect you against adware in any way. Neither would any kind of anti-virus software, which often doesn't detect adware.
    As for the other issues, it sounds like you've got some serious corruption. I would be inclined to say it sounds like a failing drive, except it sounds like you just got it replaced. How did you get all your files back after the new drive was installed?
    (Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.)

  • Problems accessing time capsule data "The operation can't be completed because the original [...]"

    So as my title would suggest, I'm having time capsule issues.
    First of all, I'm running a MBPret late 2013. Currently I'm trying to setup my time capsule in my university dorm room for two reasons:
    1) I want to use the internet they provide us.
    2) I want to use time capsule as a backup drive.
    I am not permitted to use wifi as per my contract with the university, unfortunate, but fine, I can use ethernet, I have the ethernet -> thunderbolt adapter.
    Now, thus far, I've setup my time capsule normally (this is second setup not the first) and I performed a hard reset before connecting it all here. Before here it was setup at my previous house. After that I disabled the wireless and enabled secure shared disks "with device password".
    I don't have internet access yet, though I believe this is a problem on the administrator side not mine, but the real problem is that I cannot access the data folder on my time capsule in finder. I've tried erasing the volume, hard resetting and setting up again, I keep getting the same error message:
    "The operation can’t be completed because the original item for "Data" can't be found"
    Any suggestions?
    Regards

    If you don't have applecare you will need to pay if you want the genuine article but your problem is familiar and Apple support is likely to say your the first person they have ever heard of with this problem.. even when every second post here refers to it.
    Here is my standard list. Work through it and tell me if you succeed.
    The cause is Yosemite btw.
    A factory reset of the TC is the start.. it is required so you can find it again.
    Factory reset universal
    Power off the TC.. ie pull the power cord or power off at the wall.. wait 10sec.. hold in the reset button.. be gentle.. power on again still holding in reset.. and keep holding it in for another 10sec. You may need some help as it is hard to both hold in reset and apply power. It will show success by rapidly blinking the front led. Release the reset.. and wait a couple of min for the TC to reset and come back with factory settings. If the front LED doesn’t blink rapidly you missed it and simply try again. The reset is fairly fragile in these.. press it so you feel it just click and no more.. I have seen people bend the lever or even break it. I use a toothpick as tool.
    N.B. None of your files on the hard disk of the TC are deleted.. this simply clears out the router settings of the TC.
    Setup the TC again.
    ie Start from a factory reset. No files are lost on the hard disk doing this.
    Then redo the setup from the computer with Yosemite.
    1. Use very short names.. NOT APPLE RECOMMENDED names. No spaces and pure alphanumerics.
    eg TCgen5 and TCwifi for basestation and wireless respectively.
    Even better if the issue is more wireless use TC24ghz and TC5ghz with fixed channels as this also seems to help stop the nonsense. But this can be tried in the second round.
    2. Use all passwords that also comply but can be a bit longer. ie 8-20 characters mixed case and numbers.. no non-alphanumerics.
    3. Ensure the TC always takes the same IP address.. you will need to do this on the main router using dhcp reservation.. or a bit more complex setup using static IP in the TC. But this is important.. having IP drift all over the place when Yosemite cannot remember its own name for 5 min after a reboot makes for poor networking. If the TC is main router it will not be an issue.
    4. Check your share name on the computer is not changing.. make sure it also complies with the above.. short no spaces and pure alphanumeric.. but this change will mess up your TM backup.. so be prepared to do a new full backup. Sorry.. keep this one for second round if you want to avoid a new backup.
    5. Mount the TC disk in the computer manually.
    In Finder, Go, Connect to server from the top menu,
    Type in SMB://192.168.0.254 (or whatever the TC ip is which you have now made static. As a router by default it is 10.0.1.1 and I encourage people to stick with that unless you know what you are doing).
    You can use name.. SMB://TCgen5.local where you replace TCgen5 with your TC name.. local is the default domain of the TC and doesn't change.
    However names are not so easy as IP address.. nor as reliable. At least not in Yosemite they aren't. The domain can also be an issue if you are not plugged or wireless directly to the TC.
    6. Make sure IPv6 is set to link-local only in the computer. For example wireless open the network preferences, wireless and advanced / TCP/IP.. and fix the IPv6. to link-local only.
    There is a lot more jiggery pokery you can try but the above is a good start.. if you find it still unreliable.. don't be surprised.
    You might need to do some more work on the laptop itself. eg Reset the PRAM.. has helped some people. Clean install of the OS is also helpful if you upgrade installed.
    Tell us how you go.
    Someone posted a solution.. See this thread.
    Macbook can't find Time Capsule anymore
    Start from the bottom and work up.. I have a list of good network practice changes but I have avoided Yosemites bug heaven.
    This user has had success and a few others as well.
    RáNdÓm GéÉzÁ
    Yosemite has serious DNS bug in the networking application.. here is the lets say more arcane method of fixing it by doing a network transplant from mavericks.
    http://arstechnica.com/apple/2015/01/why-dns-in-os-x-10-10-is-broken-and-what-yo u-can-do-to-fix-it/

Maybe you are looking for

  • Encore and Windows 7

    I have successfully moved my Premiere 1.5 over to my new Windows 7 system.  I now want to get a version of Encore.  Does anyone know which versions are compitable with Premiere 1.5 AND Windows 7? Thanks in advance...

  • Export JTable Column headers to Excel document

    Hello all!!! I am having a small problem while trying to export some data from a jTable to an excel document. I have a jTable and I use a custom TableModel with this: private String[] columnNames = {"First", "Second", "Third", "Forth"};as names for e

  • Change Language in jdeveloper application

    Hi i created home page using jdeveloper, my client saying that i want to change language(eg: i want chanage that application to Arabic language) so please any one help me which component i want use to change language.right now i using jdeveloper11g r

  • Error connecting jdbc with SQL server

    Hi, I get the following error when I try to run a sample program to connect SQLserver with JDBC . The driver I used to connect is " com.microsoft.jdbc.sqlserver.SQLServerDriver ". I have registered the driver properly but have problem in connecting t

  • I exported a pdf file to word but i can't edit

    I exported a pdf file to word but i can't edit. What am I doing wrong?