urgent java connection issue

can someone tell me why this is happening..

i get this error whn i try to connection to the oracle database from my java classes..for some reason it cant seem to connect...the java classes as well as the database reside on the same server

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7
        at oracle.security.o3logon.C0.r(C0)
        at oracle.security.o3logon.C0.l(C0)
        at oracle.security.o3logon.C1.c(C1)
        at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientH
        at oracle.jdbc.ttc7.O3log.<init>(O3log.java:289)
        at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
        at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:249)
        at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at uploadVoip.<init>(uploadVoip.java:23)
        at uploadVoip.main(uploadVoip.java:86)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What version of Oracle are you using?

Here's a quote from elsewhere:

"Most likely the problem stems from that fact that correct JDBC driver is not being used to connect to the DB.
If you are using Orcale 8 or 9 try using the driver from classes12.zip. Make sure this zip file is in the classpath"

Not sure if that helps at all..
trance12Author Commented:

i am using the classes12.jar file and its in the classpath
Right.. :o\

Any chance we could see your uploadVoip.java file please?
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

trance12Author Commented:
yes..here it is

import oracle.jdbc.driver.OracleDriver;
import java.sql.*;
import java.util.*;
import java.io.*;
import java.net.URL;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.MultipartPostMethod;
import org.apache.commons.logging.*;
import org.apache.commons.codec.*;

public class uploadVoip

  public uploadVoip() throws SQLException {

CallableStatement cs;

          DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

          Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:PROD", "jan", "test");


 String targetURL = "http://signup.callplus/AtoProcess/Upload.aspx";

 File targetFile = new File("/data/usr/sxt/voip.csv");

MultipartPostMethod filePost =
                        new MultipartPostMethod(targetURL);

                    try {
                                    filePost.addParameter("fileProvisioningData", targetFile);
                                    filePost.addParameter(targetFile.getName(), targetFile);
                        HttpClient client = new HttpClient();
                        int status = client.executeMethod(filePost);
                        if (status == HttpStatus.SC_OK) {
                        } else {
                            uploadResponse("connection failed",conn);
                    } catch (Exception ex) {
                    } finally {
  public void generateFile(Connection conn) throws SQLException {


          PreparedStatement pstmt = conn.prepareStatement(sql);



public void uploadResponse(String g_response,Connection conn) throws SQLException {


          PreparedStatement pstmt = conn.prepareStatement(sql);

             pstmt.setString(1, g_response);


static public void main(String[] args)  throws SQLException {

        try {
            new uploadVoip();
        catch( SQLException ie ) {



Have you ascertained that this works as a PreparedStatement before integrating it into your code? It looks more like a stored procedure to me. Perhaps it's significant that you have an unused CallableStatement in the above?
trance12Author Commented:
its actually happening for all my java classes....it was working fine before..i then moved all my jar classes to the ext directory to avoid referencing them in my call to the main class..thats when the problem started happening..i moved all the jar classes back to my working directiry and it still persists now..
>>.i then moved all my jar classes to the ext directory to avoid referencing them in my call to the main class.

That wouldn't affect your code (it would only alter classpath manipulation) so i'm wondering exactly what you did here in more detail ..?
trance12Author Commented:
i was executing all my java classes from my working directory using

java -classpath ./a.jar:b.jar:c.jar:./ uploadVoip

I wanted to avoid referencing jar classes in my calls..so i moved the jar files to the ext directory..i then tried to excute using

java  uploadVoip

and it started giving me these errors above..i themn reveted back moving the jar files back to my working directiory, but the problem kept happening..
Try doing it thus until it works again

java -Djava.ext.dirs=  -classpath ./a.jar:b.jar:c.jar:./ uploadVoip

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
trance12Author Commented:
that worked!!!..thanks heaps..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.