-2

ResultSet が閉じているかどうかを確認しているときにエラーが発生しました。これは、netbeans 7.3 で発生した実際のエラーです。

スレッド「AWT-EventQueue-0」での例外 java.lang.UnsupportedOperationException: Sun.jdbc.odbc.JdbcOdbcResultSet.isClosed(JdbcOdbcResultSet.java:6753) でまだサポートされていない操作

エラーが発生したコードは次のとおりです。

try{
    if(!rs.isClosed());
    rs.close();
}catch(SQLException ex){
    JOptionPane.showMessageDialog(rootpane, ex);
}

ご協力ありがとうございます。

4

2 に答える 2

-2
package audio;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.swing.JButton;
import javax.swing.JFrame;
import javazoom.jl.player.Player;


public class sound4 extends JFrame implements ActionListener{
   MediaPlayer mediaPlayer;
    JButton button,button2;
    Player player;
    Clip clip ;

    public sound4()
    {
        setLayout(new FlowLayout());
        setSize(300,300);
         button =new JButton("Click me");
       add(button);
       button.addActionListener(this);
       button2 =new JButton("exit");
       add(button2);
       button2.addActionListener(this);
    }

    public static void main(String[] args)
    {


           java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new sound().setVisible(true);
            }
        });


    }

    @Override
    public void actionPerformed(ActionEvent e) {

        if(e.getSource()==button)
        {
        /*String bip = "music1.mp3";
Media hit = new Media(bip);
 mediaPlayer = new MediaPlayer(hit);
 mediaPlayer.play();
 if(e.getSource()==button2)
        {
            mediaPlayer.dispose();
        }


        }*/


            //int alarmname =  cmbalarm.getSelectedIndex();

 // String playalarm = "";//String.valueOf(alarmname)+ ".wav";
  try{
         //if (cmbalarm.getSelectedIndex()==alarmname){
     AudioInputStream inputStream = AudioSystem.getAudioInputStream(new File("C:\\Users\\nida\\Music\\music1.mp3"));
        clip = AudioSystem.getClip();
       clip.open(inputStream);
        //clip.start();


       if(e.getSource()==button2)
            {
               clip.close();
               clip.stop();
              // System.exit(0);

            }
        else
        {
             clip.loop(Clip.LOOP_CONTINUOUSLY);
        }
       Thread.sleep(10000);
    }
     catch (Exception ex) {
       }


    }



    }
}
Am trying to run Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not supported yet.
    at audio.sound.actionPerformed(sound.java:81)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    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:6535)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6300)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
this code but it gives that errors.
于 2016-08-06T10:03:26.247 に答える