aspose file tools*
The moose likes JDBC and the fly likes Exception in getConnection() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Exception in getConnection()" Watch "Exception in getConnection()" New topic
Author

Exception in getConnection()

K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 68
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?
Ankit Doshi
Ranch Hand

Joined: Dec 04, 2002
Posts: 222
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="jdbcracle:thin:@172.21.202.41:1521:epsnsdev";
K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 68
Hi Ankit,
Thankyou for your reply. I am getting the same exception after trying with

String connStr="jdbcracle: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

Joined: Dec 04, 2002
Posts: 222
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.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
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

Joined: Jul 10, 2005
Posts: 68
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in getConnection()