title: Error when connecting via jdbc to Oracle 8i database using ojdbc6 driver
body: <p>I want to connect to Oracle database via jdbc using <strong>ojdbc6</strong> driver. </p>
  
  <p>I have Oracle 10g in virtual machine, and Oracle 8i at work. I'm trying to create a java application that allows me to connect to the database and execute some SQL statement.</p>
  
  <p>With <strong>Oracle 10g</strong> everything is <strong>fine</strong>, 
  <strong>but</strong> with <strong>oracle 8i (8.1.7)</strong> i get this <strong>error</strong> </p>
  
  <pre><code>java.lang.ArrayIndexOutOfBoundsException: 4
  at oracle.jdbc.driver.T4C8TTIdty.&lt;init&gt;(T4C8TTIdty.java:488)
  at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1199)
  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
  at oracle.jdbc.driver.PhysicalConnection.&lt;init&gt;(PhysicalConnection.java:553)
  at oracle.jdbc.driver.T4CConnection.&lt;init&gt;(T4CConnection.java:254)
  at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
  at java.sql.DriverManager.getConnection(DriverManager.java:582)
  at java.sql.DriverManager.getConnection(DriverManager.java:185)
  at jdbcon$4.actionPerformed(jdbcon.java:235)
  at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
  at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
  at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
  at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
  at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
  at java.awt.Component.processMouseEvent(Component.java:6297)
  at javax.swing.JComponent.processMouseEvent(JComponent.java:3275)
  at java.awt.Component.processEvent(Component.java:6062)
  at java.awt.Container.processEvent(Container.java:2039)
  at java.awt.Component.dispatchEventImpl(Component.java:4660)
  at java.awt.Container.dispatchEventImpl(Container.java:2097)
  at java.awt.Component.dispatchEvent(Component.java:4488)
  at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
  at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)
  at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
  at java.awt.Container.dispatchEventImpl(Container.java:2083)
  at java.awt.Window.dispatchEventImpl(Window.java:2489)
  at java.awt.Component.dispatchEvent(Component.java:4488)
  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:668)
  at java.awt.EventQueue.access$400(EventQueue.java:81)
  at java.awt.EventQueue$2.run(EventQueue.java:627)
  at java.awt.EventQueue$2.run(EventQueue.java:625)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
  at java.awt.EventQueue$3.run(EventQueue.java:641)
  at java.awt.EventQueue$3.run(EventQueue.java:639)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:638)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
  </code></pre>
  
  <p>And this line of the stacktrace (jdbcon is my class name)</p>
  
  <pre><code>at jdbcon$4.actionPerformed(jdbcon.java:235)
  </code></pre>
  
  <p>Take me to this line of code</p>
  
  <pre><code>con=DriverManager.getConnection("jdbc:oracle:thin:@"+adresse+":"+port+":"+bd,user,pass);
  </code></pre>
  
  <p><strong>The source code</strong></p>
  
  <pre><code>    try {
              Class.forName("oracle.jdbc.driver.OracleDriver");
               con=DriverManager.getConnection("jdbc:oracle:thin:@"+adresse+":"+port+":"+bd,user,pass);
                  if(con.isValid(10))
                      //System.out.println("Connexion réussie");
                      JOptionPane.showMessageDialog(null, "Connexion réussie");
  </code></pre>
  
  <p><strong>Note</strong></p>
  
  <p>when i use a wrong <strong>SID</strong> it gives me this error :</p>
  
  <pre><code>java.sql.SQLException: Listener refused the connection with the following error:
  ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
  </code></pre>
  
  <p>This means that the host,Port are okay. And when i use the <strong>right SID</strong> i get the previous error .</p>
  
  <p>This problem is only with <strong>oracle 8i</strong>. </p>