1

I am connecting my Project to Wampserver. The Same project connects with database in other system with same code and method, but when I try it on my system it shows below error msg:

  run:
 java.sql.SQLException: java.lang.VerifyError: (class: com/mysql/jdbc/DatabaseMetaData, method: supportsRefCursors signature: ()Z) Illegal use of nonvirtual function call
 java.sql.SQLException: java.lang.VerifyError: (class: com/mysql/jdbc/DatabaseMetaData, method: supportsRefCursors signature: ()Z) Illegal use of nonvirtual function call
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:435)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
at java.sql.DriverManager.getConnection(DriverManager.java:619)
at java.sql.DriverManager.getConnection(DriverManager.java:244)
at sea.DBClass.ConnectDB(DBClass.java:30)
at sea.Interface.jButton1ActionPerformed(Interface.java:63)
at sea.Interface.access$000(Interface.java:13)
at sea.Interface$1.actionPerformed(Interface.java:38)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6513)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3322)
at java.awt.Component.processEvent(Component.java:6278)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4869)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4691)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4834)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4494)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4424)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2721)
at java.awt.Component.dispatchEvent(Component.java:4691)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:722)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:681)
at java.awt.EventQueue$3.run(EventQueue.java:679)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:695)
at java.awt.EventQueue$4.run(EventQueue.java:693)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:692)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
BUILD SUCCESSFUL (total time: 8 seconds)

My code for connection is below:

  public class DBClass {

public static Connection ConnectDB (){

    try{
String url = "jdbc:mysql://localhost:3306/";
String DBName = "sea";
String Drivers = "com.mysql.jdbc.Driver";
String user ="root";
String pass = "";
Class.forName(Drivers);

        java.sql.Connection con = DriverManager.getConnection(url+DBName,user,pass);
JOptionPane.showMessageDialog(null, "Connectd");
return con;

}catch (Exception e){
JOptionPane.showMessageDialog(null,e);
e.printStackTrace();
return null;
}

and the Exception caught in try catch is below:

" ERROR java.sql.SQLException: java.lang.VerifyError: (class: com/mysql/jdbc/DatabaseMetaData, method: supportsRefCursors signature: ()Z) Illegal use of nonvirtual function call "

1 Answer 1

2

You can install Java Lambda version . Java lambda version solved this problem. https://jdk8.java.net/lambda/

Sign up to request clarification or add additional context in comments.

2 Comments

do i have to uninstall current version of JAVA?? which is JAVA 8
but can you tell me what is the connection lambda version?? Java 8 is installed in my other system .. it works fine, but my laptop needs to be installed with lambda version?? why so?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.