private void addArtistActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addArtistActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            searchText.setText("");
            try {
                Class.forName("oracle.jdbc.driver.OracleDriver");
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(AdminView.class.getName()).log(Level.SEVERE, null, ex);
            }
            // TODO add your handling code here:
//            JTextField id = new JTextField();
            JTextField name = new JTextField();
            JTextField about = new JTextField();
            Object[] input = {
//                "Id : ", id,
                "Name : ", name,
                "About : ", about,
            };
            int option = JOptionPane.showConfirmDialog(this, input, "Enter Artist details", JOptionPane.OK_CANCEL_OPTION);
            if(option == JOptionPane.OK_OPTION) {
                 try{  
                    Class.forName("oracle.jdbc.driver.OracleDriver");  
                     Connection con = DriverManager.getConnection(
                             "jdbc:oracle:thin:@localhost:1521:newdatabase","system","not12345");
                    CallableStatement ps = con.prepareCall ("{call addartist(?, ?, ?)}");
                    ps.setString(1,null);  
                    ps.setString(2, name.getText());
                    ps.setString(3, about.getText());
                    ps.executeUpdate();
                    ps.close();
                    con.close();  
                } catch (Exception e) {e.printStackTrace();}  
                JOptionPane.showMessageDialog(this, "Success!\n");
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(this, "Error!\n"+e.getMessage());
        }
    }
private void addArtistActionPerformed(java.awt.event.ActionEvent evt) {       
        try {
           
            searchText.setText("");
            try {
                Class.forName("oracle.jdbc.driver.OracleDriver");
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(AdminView.class.getName()).log(Level.SEVERE, null, ex);
            }
           
            JTextField name = new JTextField();
            JTextField about = new JTextField();
            Object[] input = {
                "Name : ", name,
                "About : ", about,
            };
            int option = JOptionPane.showConfirmDialog(this, input, "Enter Artist details", JOptionPane.OK_CANCEL_OPTION);
            if(option == JOptionPane.OK_OPTION) {
                 try{  
                    Class.forName("oracle.jdbc.driver.OracleDriver");  
                     Connection con = DriverManager.getConnection(
                             "jdbc:oracle:thin:@localhost:1521:newdatabase","system","not12345");
                    CallableStatement ps = con.prepareCall ("{call addartist(?, ?, ?)}");
                    ps.setString(1,null);  
                    ps.setString(2, name.getText());
                    ps.setString(3, about.getText());
                    ps.executeUpdate();
                    ps.close();
                    con.close();  
                } catch (Exception e) {e.printStackTrace();}  
                JOptionPane.showMessageDialog(this, "Success!\n");
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(this, "Error!\n"+e.getMessage());
        }
    }
private void addartistactionperformed(java.awt.event.actionevent evt) { try { searchtext.settext(""); try { class.forname("oracle.jdbc.driver.oracledriver"); } catch (classnotfoundexception ex) { logger.getlogger(adminview.class.getname()).log(level.severe, null, ex); } jtextfield name = new jtextfield(); jtextfield about = new jtextfield(); object[] input = { "name : ", name, "about : ", about, }; int option = joptionpane.showconfirmdialog(this, input, "enter artist details", joptionpane.ok_cancel_option); if(option == joptionpane.ok_option) { try{ class.forname("oracle.jdbc.driver.oracledriver"); connection con = drivermanager.getconnection( "jdbc:oracle:thin:@localhost:1521:newdatabase","system","not12345"); callablestatement ps = con.preparecall ("{call addartist(?, ?, ?)}"); ps.setstring(1,null); ps.setstring(2, name.gettext()); ps.setstring(3, about.gettext()); ps.executeupdate(); ps.close(); con.close(); } catch (exception e) {e.printstacktrace();} joptionpane.showmessagedialog(this, "success!\n"); } } catch (exception e) { joptionpane.showmessagedialog(this, "error!\n"+e.getmessage()); } }