• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception in getConnection()

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
im getting the
java.lang.ArrayIndexOutOfBoundsException: 7

while running the command.
the output is
hi
Exception occured ! java.lang.ArrayIndexOutOfBoundsException: 7
and the code is..



the second Hi in the code is not pronted . so i concluded that the exception is from getConnection().
can you suggest me, what may be the mistake?
 
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vidhyakar,

I tried with exact same code and I didn't get any ArrayIndexOutOfBoundsException.

Also, try defining your URL this way and see what happens.
String conStr="jdbc:oracle:thin:@172.21.202.41:1521:epsnsdev";
 
K Vidhyakar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ankit,
Thankyou for your reply. I am getting the same exception after trying with

String connStr="jdbc:oracle:thin:@172.21.202.41:1521:epsnsdev";

but when i try using ojdbc14.zip driver , its working perfectly..

but this happens while using classes12.zip

can you identify the problem?

waiting fo your reply.
 
Ankit Doshi
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

There doesn't seem to be any apparent reason why it should not work with classes12.jar.

One of the things you could verify is that your classes12.jar is not corrupted.

If you want to debug this further, copy and paste the entire exception stack trace. Also paste your code again with the line numbers, so that the lines in the exception stack trace can be related to code.
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What jdk version are you using?

classes12.zip or classes12.jar -- classes for use with jdk 1.2 and 1.3

ojdbc14.jar -- classes for use with JDK 1.4 and 1.5
 
K Vidhyakar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ankit and Carol,

i was using classes12.zip for oracle 8i. but the oracle im using is 9i. after replacing with 9i version of classes12 , its working properly.

Once again, i would like to thank you for your replies.
 
I am not young enough to know everything. - Oscar Wilde This tiny ad thinks it knows more than Oscar:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic