private void jb_executeActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jb_executeActionPerformed
    {//GEN-HEADEREND:event_jb_executeActionPerformed
        try
        {
            Statement st;
            Connection connection = mysql_connection.getConnection();
            st = connection.createStatement();
            if (jtp_sql_query.getText().toLowerCase().startsWith("select"))
            {
                Vector data_vector = new Vector();
                Vector column_name = new Vector();


                ResultSet result = st.executeQuery(jtp_sql_query.getText());
                if (result != null)
                {
                    ResultSetMetaData metaDt = result.getMetaData();

                    for (int i = 1; i <= metaDt.getColumnCount(); i++)
                    {
                        column_name.add(metaDt.getColumnName(i));
                    }
                    while (result.next())
                    {
                        Vector row = new Vector();
                        for (int i = 1; i <= metaDt.getColumnCount(); i++)
                        {
                            row.add(result.getObject(i));
                        }
                        data_vector.add(row);
                    }
                    DefaultTableModel dtm = new DefaultTableModel(data_vector, column_name)
                    {
                        @Override
                        public boolean isCellEditable(int row, int column)
                        {
                            return false;
                        }

                        public Color getRowColour(int row)
                        {
                            return row % 2 == 1 ? Color.LIGHT_GRAY : Color.WHITE;
                        }
                    };

                    jt_result.setModel(dtm);

                    jt_result.revalidate();
                    result.close();
                    jl_message.setText("");
                }
                else
                {
                    jl_message.setText("Problem u izvrsavanju upita!");
                }

            } else
            {
                st.executeUpdate(jtp_sql_query.getText());
                jt_result.setModel(new DefaultTableModel());
                jl_message.setText("");
            }
            st.close();
        } catch (SQLException ex)
        {
            Log.loge(ex.getMessage());
            jl_message.setText(ex.getMessage());
        }
    }//GEN-LAST:event_jb_executeActionPerformed