在iReport工具中创建oracle连接时出现问题

时间:2014-05-12 13:50:03

标签: jasper-reports ireport

我是iReport工具的新手。我正在尝试创建oracle连接但在输入所有必需的详细信息后,当我单击“测试连接”按钮时,它显示的错误如

Error that is displaying while Test connection

Exception看起来像

Exception


Message:
java.lang.ArrayIndexOutOfBoundsException: 7
Level:
SEVERE
Stack Trace:
7
oracle.security.o3logon.C1.r(C1)
oracle.security.o3logon.C1.l(C1)
oracle.security.o3logon.C0.c(C0)
oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
oracle.jdbc.ttc7.O3log.<init>(O3log.java:290)
oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:252)
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)         com.jaspersoft.ireport.designer.connection.JDBCConnection.getConnection(JDBCConnection.java:140)
com.jaspersoft.ireport.designer.connection.JDBCConnection.test(JDBCConnection.java:449)
com.jaspersoft.ireport.designer.connection.gui.ConnectionDialog.jButtonTestActionPerformed(ConnectionDialog.java:335)
com.jaspersoft.ireport.designer.connection.gui.ConnectionDialog.access$300(ConnectionDialog.java:43)
com.jaspersoft.ireport.designer.connection.gui.ConnectionDialog$4.actionPerformed(ConnectionDialog.java:290)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
java.awt.Component.processMouseEvent(Component.java:6038)
javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
java.awt.Component.processEvent(Component.java:5803)
java.awt.Container.processEvent(Container.java:2058)
java.awt.Component.dispatchEventImpl(Component.java:4410)
java.awt.Container.dispatchEventImpl(Container.java:2116)
java.awt.Component.dispatchEvent(Component.java:4240)
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
java.awt.Container.dispatchEventImpl(Container.java:2102)
java.awt.Window.dispatchEventImpl(Window.java:2429)
java.awt.Component.dispatchEvent(Component.java:4240)
java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
java.awt.Dialog$1.run(Dialog.java:1039)
java.awt.Dialog$3.run(Dialog.java:1091)
java.security.AccessController.doPrivileged(Native Method)
java.awt.Dialog.show(Dialog.java:1089)
java.awt.Component.show(Component.java:1419)
java.awt.Component.setVisible(Component.java:1372)
java.awt.Window.setVisible(Window.java:801)
java.awt.Dialog.setVisible(Dialog.java:979)
com.jaspersoft.ireport.designer.welcome.QuickStartPanel.jButton1ActionPerformed(QuickStartPanel.java:295)
com.jaspersoft.ireport.designer.welcome.QuickStartPanel.access$200(QuickStartPanel.java:50)
com.jaspersoft.ireport.designer.welcome.QuickStartPanel$2.actionPerformed(QuickStartPanel.java:124)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
java.awt.Component.processMouseEvent(Component.java:6038)
javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
java.awt.Component.processEvent(Component.java:5803)
java.awt.Container.processEvent(Container.java:2058)
java.awt.Component.dispatchEventImpl(Component.java:4410)
java.awt.Container.dispatchEventImpl(Container.java:2116)
java.awt.Component.dispatchEvent(Component.java:4240)
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
java.awt.Container.dispatchEventImpl(Container.java:2102)
java.awt.Window.dispatchEventImpl(Window.java:2429)
java.awt.Component.dispatchEvent(Component.java:4240)
java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

我已经在classpath中添加了ojdbc.jar文件,并验证了用户名和密码。请帮忙。

提前致谢。

2 个答案:

答案 0 :(得分:1)

在iReport的类路径中添加classes.12.jar文件后检查这个,或者你可以直接复制到

C:\Program Files\Jaspersoft\iReport-5.2.0\ireport\libs 

1: - 要添加新数据库,请单击数据库图标 - &gt; JDBC连接 - &gt;下。

2: - 选择JDBC驱动程序类Oracle: -          (oracle.jdbc.driver.OracleDriver)

3: - URL       语法:jdbc:oracle:thin:@localhost:1521:DatabaseName     示例1:jdbc:oracle:thin:@localhost:1521:orcl                                         (其中orcl是Oracle的SID)     例2:jdbc:oracle:thin:@ 192.168.2.9:1521:orcl                                          (使用IP的远程数据库连接)

4)用户名&amp;密码

5)单击“测试连接”。

答案 1 :(得分:0)

我遇到了同样的问题,我按照以下步骤操作:

  1. ojdbc6.jar 复制到ireports / libs。
  2. 转到工具> 选项 在“ 类路径”标签下,您需要添加已添加libs文件夹的新ojdbc jar。
  3. 重新启动 jaspersoft ireports designer 软件。

现在,当您尝试添加新数据库时,oracle选项是 black 而不是 red ,这意味着它已启用。