Press button to execute MYSQL query on database

Hi, I was looking for a solution to this:
I want to create a button in a jsp page.
When a user presses the button, it executes a SQL Query on a database.
There is no need to take any info from the jsp page.
Is there a solution to this problem?
For example, when I press the button, I want it to execute a query like this:
INSERT INTO table3(name)
SELECT name FROM table1,table2
WHERE table1.timestamp>table2.timestamp
GROUP BY name;This query is functional in MySQL, and all I need is to convince that button to execute the query.
table1 contains 100 values
table2 contains only one row, and only one timestamp value and is a value inserted by user through a jsp page
Extra:
After this is executed, it would be nice to display a confirmation in the initial page.
Also, it would be nice to be able too see what values were inserted into table 2
I have been searching a lot for a solution in many forums, but with no results yet.
I can't believe jsp doesn't have a solution for this.
Please help me.
Thanks :)

Look into JDBC
The following will give you a start.
http://java.sun.com/products/jdbc/
http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/
http://java.sun.com/products/jdbc/download.html
http://java.sun.com/docs/books/tutorial/jdbc/basics/
http://java.sun.com/developer/onlineTraining/Database/JDBCShortCourse/
rykk

Similar Messages

  • GO button to execute a query once report parameters are selected.

    I am familiar with the GO button depicted in chapter 10 of the 2 Day Developer manual that does not cause the report to be rendered until a user chooses a value from a select list of values. The GO button is used in conjunction with Null Value Text (ex. -Select-), Null Value (ex. -1), and Default (ex.-1).
    I need an alternative to the above method that will still force the user to pick a value from the List Of Values parameters prior to executing the query and rendering the report. Please provide.
    Thanks, Don From Maine

    Why don't you use a validation process?
    Denes Kubicek

  • Only firefox executing mysql query two times. but other browser works perfect why?

    i am a web developer. and i am facing a problem only with firefox. every time i use MySQL query in my php code fire fox execute it two times. but same query is working fine on other browsers.

    Yes, the problem is seen without extensions and also in safe mode.
    But, I am starting to think that firefox is running low on memeory or CPU.
    Without extensions the possibility of failing is 1 in 3.
    I am still unable to explain why closing the browser or aborting the request can cause the stuck request to immediately reach the server.
    Is there a way to collect Firefox logs and post it here ?

  • How to set the link to the result which are executed my query from database

    Hi,
    i have successfully displayed the results which are available in the database by jdbc, query.
    Then, How to give the link like href to each & every result...
    note: The number of records may be change. depending upon the records availablity in the database. but every result have the link.
    Thanks in advance.
    Regards
    Kumar

    hai kumar..
    i post an example code ..
    <%
    ResultSet rs1=stmt.executeQuery("select fromu,subject,message,mdate,status,mesid from message where to='" + lname +"'" );
    while(rs1.next())
         l=rs1.getLong(6);
         out.println("<tr align='center'> <td> <a href='deletemessage.jsp?mesid="+ l + "'>Delete </a></td><td>" + rs1.getString(1) +"</td><td> <a href='viewmessage.jsp?mesid="+ l +"'>"+ rs1.getString(2) +"</a></td><td>"+ rs1.getString(4) +"</td><td>"+ rs1.getString(5) +"</td></tr>");
    %>

  • How to execute a query when pressing a button

    hi,
    i created a frame (ADF Swing).
    in this frame i have a textfield, a button and a jtable.
    i want when i press on the button i execute a query which has a condition in the textfield and i want that the result will be shown in the jtable.
    thanks for help.

    Hello,
    I would test the record status of the first record in the block. If this status is 'NEW', then there is no record retrieved, so that you can exit the query mode with exit_form()
    Francois

  • While executing the query getting an error u2018Page Not Foundu2019 in the bowser.

    Hello,
    I opened a Bex Query in Query Analyzer and clicked on the Execute button to execute the query in our portal site. But I am getting an error u2018Page Not Foundu2019 in the bowser.
    As I am new to BI,Kindly guide me through the steps.
    what all setting needs to be done?
    Regards,
    Rachel

    Hi,
    The Path is C:\WINDOWS\system32\drivers\etc\hosts
    You need to update "host file" in your server/in your PC. So ask Network people to do it and also you need to change your browser LANsettings.
    Eg:   11.11.8.161     BWQ1     BWQ1.***.com
    Like above you need to change in your host file.
    Thanks
    Reddy
    Edited by: Surendra Reddy on Nov 27, 2008 8:12 AM

  • [SLVD] MySQL Query Browser (1.2.12) hangs when changing schma/database

    After a rather big upgrade yesterday (see paste below) I have got a problem with MySQL query browser which is found in package mysql-gui-tools. Everything else seems to be okay, but after upgrading mysql-gui-tools from 5.0r12-3 to 5.0r14-1 (..and now, after another update, its at 5.0r14-2) it is no longer able to refresh schema/databases. Every time I try to change/refresh schema in the schema menu to the right the program hangs and I have to kill it. A refresh icon appears as normal to the left of the schema I'm trying to refresh, but that icon too has frozen. I am however able to execute normal SELECT queries etc if I write the full "path" to the table in the SQL query, but when I try a USE query the same thing happens.
    I have done some searching on the Internet about this and found this thread to be interesting. Too bad it's from July 2007..
    I tried to downgrade to the old version of query browser, but then I got this problem:
    /usr/bin/mysql-query-browser-bin: error while loading shared libraries: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory
    ..So I guess theres a dependency problem here with the old version.
    Has anyone else got any problem with the MySQL Query Browser after upgrade or has any ideas for a solution?
    Log from pacman:
    [2009-04-12 13:52] synchronizing package lists
    [2009-04-12 13:52] starting full system upgrade
    [2009-04-12 13:55] upgraded xf86-input-evdev (2.1.2-1 -> 2.2.1-1)
    [2009-04-12 13:55] upgraded xorg-server (1.5.3-5 -> 1.6.0-3)
    [2009-04-12 13:56] synchronizing package lists
    [2009-04-12 13:56] starting full system upgrade
    [2009-04-12 13:56] upgraded glib2 (2.20.0-1 -> 2.20.1-1)
    [2009-04-12 13:56] upgraded libcap (1.10-2 -> 2.16-3)
    [2009-04-12 13:56] upgraded avahi (0.6.24-1 -> 0.6.24-3)
    [2009-04-12 13:56] upgraded cdrkit (1.1.9-1 -> 1.1.9-2)
    [2009-04-12 13:56]
    [2009-04-12 13:56] >>> Deluge's daemon is running with the "deluge" user. The default download directory is /srv/deluge/
    [2009-04-12 13:56]
    [2009-04-12 13:56] upgraded deluge (1.1.5-1 -> 1.1.6-3)
    [2009-04-12 13:56] upgraded jack-audio-connection-kit (0.109.2-2 -> 0.116.2-1)
    [2009-04-12 13:56] upgraded gstreamer0.10-bad-plugins (0.10.11-2 -> 0.10.11-3)
    [2009-04-12 13:56] upgraded hdparm (9.12-1 -> 9.14-1)
    [2009-04-12 13:56] upgraded iptables (1.4.2-1 -> 1.4.3.1-1)
    [2009-04-12 13:56] upgraded kbproto (1.0.3-1 -> 1.0.3-2)
    [2009-04-12 13:57] upgraded kdelibs (4.2.2-3 -> 4.2.2-4)
    [2009-04-12 13:57] upgraded kernel26-firmware (2.6.28-1 -> 2.6.29-1)
    [2009-04-12 13:59] >>> Updating module dependencies. Please wait ...
    [2009-04-12 13:59] >>> MKINITCPIO SETUP
    [2009-04-12 13:59] >>> ----------------
    [2009-04-12 13:59] >>> If you use LVM2, Encrypted root or software RAID,
    [2009-04-12 13:59] >>> Ensure you enable support in /etc/mkinitcpio.conf .
    [2009-04-12 13:59] >>> More information about mkinitcpio setup can be found here:
    [2009-04-12 13:59] >>> http://wiki.archlinux.org/index.php/Mkinitcpio
    [2009-04-12 13:59]
    [2009-04-12 13:59] >>> Generating initial ramdisk, using mkinitcpio. Please wait...
    [2009-04-12 13:59] ==> Building image "default"
    [2009-04-12 13:59] ==> Running command: /sbin/mkinitcpio -k 2.6.29-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26.img
    [2009-04-12 13:59] :: Begin dry run
    [2009-04-12 13:59] :: Parsing hook [base]
    [2009-04-12 13:59] :: Parsing hook [udev]
    [2009-04-12 13:59] :: Parsing hook [autodetect]
    [2009-04-12 13:59] :: Parsing hook [pata]
    [2009-04-12 13:59] :: Parsing hook [scsi]
    [2009-04-12 13:59] :: Parsing hook [sata]
    [2009-04-12 13:59] :: Parsing hook [usbinput]
    [2009-04-12 13:59] :: Parsing hook [keymap]
    [2009-04-12 13:59] :: Parsing hook [filesystems]
    [2009-04-12 13:59] :: Generating module dependencies
    [2009-04-12 13:59] :: Generating image '/boot/kernel26.img'...SUCCESS
    [2009-04-12 13:59] ==> SUCCESS
    [2009-04-12 13:59] ==> Building image "fallback"
    [2009-04-12 13:59] ==> Running command: /sbin/mkinitcpio -k 2.6.29-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26-fallback.img -S autodetect
    [2009-04-12 13:59] :: Begin dry run
    [2009-04-12 13:59] :: Parsing hook [base]
    [2009-04-12 13:59] :: Parsing hook [udev]
    [2009-04-12 13:59] :: Parsing hook [pata]
    [2009-04-12 13:59] :: Parsing hook [scsi]
    [2009-04-12 13:59] :: Parsing hook [sata]
    [2009-04-12 13:59] :: Parsing hook [usbinput]
    [2009-04-12 13:59] :: Parsing hook [keymap]
    [2009-04-12 13:59] :: Parsing hook [filesystems]
    [2009-04-12 13:59] :: Generating module dependencies
    [2009-04-12 14:00] :: Generating image '/boot/kernel26-fallback.img'...SUCCESS
    [2009-04-12 14:00] ==> SUCCESS
    [2009-04-12 14:00] upgraded kernel26 (2.6.28.8-1 -> 2.6.29.1-3)
    [2009-04-12 14:00] upgraded klibc-udev (140-1 -> 141-1)
    [2009-04-12 14:00] upgraded libavc1394 (0.5.3-1 -> 0.5.3-2)
    [2009-04-12 14:00] upgraded libcddb (1.3.0-3 -> 1.3.2-1)
    [2009-04-12 14:00] upgraded libdatrie (0.1.2-1 -> 0.2.1-1)
    [2009-04-12 14:00] upgraded libdrm (2.3.1-3 -> 2.4.9-1)
    [2009-04-12 14:00] upgraded libdvdread (0.9.7-1 -> 0.9.7-2)
    [2009-04-12 14:00] upgraded libfontenc (1.0.4-1 -> 1.0.4-2)
    [2009-04-12 14:00] upgraded libid3tag (0.15.1b-2 -> 0.15.1b-3)
    [2009-04-12 14:00] upgraded libmatroska (0.8.1-1 -> 0.8.1-2)
    [2009-04-12 14:00] upgraded libmpd (0.16.1-1 -> 0.18.0-1)
    [2009-04-12 14:00] upgraded libmysqlclient (5.0.77-1 -> 5.1.33-1)
    [2009-04-12 14:00] upgraded libogg (1.1.3-1 -> 1.1.3-2)
    [2009-04-12 14:00] upgraded libsamplerate (0.1.6-1 -> 0.1.7-1)
    [2009-04-12 14:00] upgraded libthai (0.1.9-1 -> 0.1.11-1)
    [2009-04-12 14:00] upgraded libx11 (1.2-1 -> 1.2.1-1)
    [2009-04-12 14:00] installed libftdi (0.15-1)
    [2009-04-12 14:00] upgraded lirc-utils (0.8.4-1 -> 0.8.5pre2-1)
    [2009-04-12 14:00] upgraded m4 (1.4.12-1 -> 1.4.13-1)
    [2009-04-12 14:00] upgraded man-db (2.5.4-2 -> 2.5.5-1)
    [2009-04-12 14:00] upgraded man-pages (3.19-1 -> 3.20-1)
    [2009-04-12 14:00] upgraded nvidia-utils (180.29-3 -> 180.44-1)
    [2009-04-12 14:00] installed dri2proto (1.99.3-1)
    [2009-04-12 14:01] upgraded mesa (7.2-1 -> 7.4-1)
    [2009-04-12 14:01] upgraded mpfr (2.3.2-2 -> 2.4.1-1)
    [2009-04-12 14:01] upgraded mpg123 (1.7.1-4 -> 1.7.2-1)
    [2009-04-12 14:01] upgraded mysql-clients (5.0.77-1 -> 5.1.33-1)
    [2009-04-12 14:01] upgraded mysql (5.0.77-3 -> 5.1.33-1)
    [2009-04-12 14:01] upgraded mysql-gui-tools (5.0r12-3 -> 5.0r14-1)
    [2009-04-12 14:01] In order to use the new nvidia module, exit Xserver and unload it manually.
    [2009-04-12 14:01] upgraded nvidia (180.29-3 -> 180.44-1)
    [2009-04-12 14:01] warning: /etc/pacman.d/mirrorlist installed as /etc/pacman.d/mirrorlist.pacnew
    [2009-04-12 14:01] upgraded pacman-mirrorlist (20090108-1 -> 20090405-1)
    [2009-04-12 14:01] upgraded pango (1.24.0-1 -> 1.24.0-2)
    [2009-04-12 14:01] upgraded php (5.2.9-2 -> 5.2.9-3)
    [2009-04-12 14:01] upgraded pm-utils (1.2.4-3 -> 1.2.5-1)
    [2009-04-12 14:01] installed perl-xyne-common (0.01-5)
    [2009-04-12 14:01] installed perl-html-tagset (3.20-1)
    [2009-04-12 14:01] installed perl-html-parser (3.60-1)
    [2009-04-12 14:01] installed perl-libwww (5.825-1)
    [2009-04-12 14:01] installed perl-xyne-arch (0.03-5)
    [2009-04-12 14:01] ######################
    [2009-04-12 14:01] ## IMPORTANT NOTICE ##
    [2009-04-12 14:01] ######################
    [2009-04-12 14:01] Powerpill options and configuration file syntax have changed with
    [2009-04-12 14:01] version 16.0. Please remove old configuration files and use the
    [2009-04-12 14:01] default configuration file at /etc/powerpill.conf as a template for new
    [2009-04-12 14:01] ones. Please see the man page for information on the command-line options.
    [2009-04-12 14:01] upgraded powerpill (15.12-1 -> 16.0-5)
    [2009-04-12 14:01] upgraded python-numpy (1.2.1-4 -> 1.3.0-1)
    [2009-04-12 14:02] upgraded qt (4.5.0-3 -> 4.5.0-4)
    [2009-04-12 14:02] upgraded qt3 (3.3.8-9 -> 3.3.8-10)
    [2009-04-12 14:02] upgraded redland (1.0.8-1 -> 1.0.8-3)
    [2009-04-12 14:02] upgraded tdb (3.3.1-1 -> 3.3.3-1)
    [2009-04-12 14:02] upgraded smbclient (3.3.1-1 -> 3.3.3-1)
    [2009-04-12 14:02] upgraded subversion (1.6.0-2 -> 1.6.1-2)
    [2009-04-12 14:02] upgraded syslog-ng (3.0.1-4 -> 3.0.1-6)
    [2009-04-12 14:02] upgraded tzdata (2009d-1 -> 2009e-1)
    [2009-04-12 14:02] upgraded udev (140-2 -> 141-1)
    [2009-04-12 14:02] upgraded xf86-input-keyboard (1.3.2-1 -> 1.3.2-2)
    [2009-04-12 14:02] upgraded xf86-input-mouse (1.3.0-1 -> 1.4.0-2)
    [2009-04-12 14:02] upgraded xf86-video-vesa (2.1.0-1 -> 2.2.0-1)
    [2009-04-12 14:02] upgraded xfce4-mpc-plugin (0.3.3-2 -> 0.3.3-3)
    [2009-04-12 14:02] upgraded xorg-server-utils (7.4-3 -> 7.4-4)
    [2009-04-12 14:02] upgraded xorg-utils (7.4-2 -> 7.4-3)
    Last edited by siaco (2009-04-14 21:42:10)

    I found the error on this. In the current PGKBUILD found in AUR, the patch mysql-gui-tools.chema_change_freeze_bug.patch is no longer applied.
    I downloaded all related files to this package and built it myself now, with some changes to PGKBUILD and the mysql-gui-tools.chema_change_freeze_bug.patch. It works again :-)
    New PGKBUILD:
    # $Id: PKGBUILD,v 1.14 2009/04/12 11:52:45 dsa Exp $
    # Maintainer: Douglas Soares de Andrade <[email protected]>
    # Contributor: Vinay S Shastry <[email protected]>
    pkgname=mysql-gui-tools
    pkgver=5.0r14
    pkgrel=2
    arch=('i686' 'x86_64')
    pkgdesc="Set of programs to manage and interact with a MySQL server."
    url="http://www.mysql.com/products/tools/"
    license=('GPL')
    source=(http://mirrors.uol.com.br/pub/mysql/Downloads/MySQLGUITools/$pkgname-$pkgver.tar.gz
    bad-char.patch
    mysql-gui-tools-sigc_2.1.1_api_fixes.diff
    mysql-gui-tools-5.0_p12-deprecated-gtk+-api.patch
    mysql-gui-tools-gcc43.patch
    mysql-gui-tools.chema_change_freeze_bug.patch)
    depends=('gtkmm' 'gtkhtml' 'libmysqlclient' 'pcre')
    replaces=('mysql-administrator' 'mysql-query-browser')
    conflicts=('mysql-administrator' 'mysql-query-browser')
    provides=('mysql-gui-common' 'mysql-administrator' 'mysql-query-browser')
    makedepends=('pkgconfig' 'lua' 'libxml2' 'libgnomeprint')
    options=('!makeflags')
    build() {
    cd $startdir/src/$pkgname-$pkgver
    # Patch from mysql.com to fix the freeze when selecting a schema
    patch -p1 < ../mysql-gui-tools.chema_change_freeze_bug.patch || return 1
    # Patch to make 5.0r14 compile
    patch -Np1 < $startdir/src/bad-char.patch
    patch -Np1 < $startdir/src/mysql-gui-tools-sigc_2.1.1_api_fixes.diff
    patch -Np1 < $startdir/src/mysql-gui-tools-gcc43.patch
    patch -Np0 < $startdir/src/mysql-gui-tools-5.0_p12-deprecated-gtk+-api.patch
    cd $startdir/src/$pkgname-$pkgver/common
    sh autogen.sh
    ./configure --prefix=/usr --datarootdir=/usr/share --with-gtkhtml=libgtkhtml-3.14 || return 1
    make || return 1
    make DESTDIR=$startdir/pkg install || return 1
    cd ..
    cp -R common mysql-gui-common
    cd $startdir/src/$pkgname-$pkgver/administrator
    sh autogen.sh
    ./configure --prefix=/usr --datarootdir=/usr/share --with-gtkhtml=libgtkhtml-3.14 || return 1
    make || return 1
    make DESTDIR=$startdir/pkg install || return 1
    cd $startdir/src/$pkgname-$pkgver/query-browser
    sh autogen.sh
    ./configure --prefix=/usr --datarootdir=/usr/share --with-gtkhtml=libgtkhtml-3.14 || return 1
    make CFLAGS="${CFLAGS} -D_GNU_SOURCE" || return 1
    make DESTDIR=$startdir/pkg install || return 1
    #cd $startdir/src/$pkgname-$pkgver/mysql-workbench
    #patch -p1 < ../../mysql-gui-tools-5.0_p12-workbench-lua.patch
    #./configure --prefix=/usr --with-gtkhtml=libgtkhtml-3.14 || return 1
    #make || return 1
    #make DESTDIR=$startdir/pkg install
    # Some adjusts to make mysql-workbench run
    #cd $startdir/pkg/usr/bin
    #mv mysql-workbench mysql-wb
    #mv mysql-workbench-bin mysql-wb-bin
    #install -m755 $startdir/src/mysql-workbench.sh mysql-workbench
    #rm -rf $startdir/pkg/usr/lib/
    # Fixed startup scripts
    install -m755 $startdir/mysql-administrator $pkgdir/usr/bin
    install -m755 $startdir/mysql-query-browser $pkgdir/usr/bin
    md5sums=('b8efefbf20b7264c8f3afd34424467d7'
    '4279c75bb5e6c2bfcb16c98817d55b80'
    '4625629385142862cd01d37f814d5e80'
    '33205d45329ab4fa4096b6b298a60b2c'
    '1368384dac87bc0a64adb774ab2e6cbd'
    '2ff840932405f7a6a6863f633a639fe9')
    New mysql-gui-tools.chema_change_freeze_bug.patch: (only changes to paths in file. Don't know if this was really needed, but I belive so.)
    diff -ruN mysql-gui-tools-5.0r11.ORIG/query-browser/source/linux/MQQueryDispatcher.cc mysql-gui-tools-5.0r11/query-browser/source/linux/MQQueryDispatcher.cc
    --- mysql-gui-tools-5.0r11.ORIG/query-browser/source/linux/MQQueryDispatcher.cc 2007-02-21 01:31:19.000000000 +0000
    +++ mysql-gui-tools-5.0r11/query-browser/source/linux/MQQueryDispatcher.cc 2007-11-09 15:31:38.000000000 +0000
    @@ -558,8 +558,8 @@
    Gtk::Main::instance()->run();
    - while(!req->is_complete())
    +// while(!req->is_complete())
    +// ;
    return sps;
    I hope this helps anyone else who needs to fix this!

  • Weird problem with mysql query and data table buttons !!!!

    Hi,
    I'm using jsc 2 update 1 on windows and mysql 4.1 . I have a page with a data table. One column of the data table contains "Details" buttons.
    Source query for the table is :
    SELECT tbl_tesserati.idtbl_tesserati idTesserato,
    tbl_tesserati.num_tessera,
    tbl_tesserati.nome,
    tbl_societa.codice_meccanografico
    FROM tbl_tesserati
    INNER JOIN tbl_rel_tesserato_discipline_societa ON tbl_tesserati.idtbl_tesserati = tbl_rel_tesserato_discipline_societa.id_tesserato
    INNER JOIN tbl_cariche ON      tbl_rel_tesserato_discipline_societa.id_carica = tbl_cariche.idtbl_cariche
    INNER JOIN tbl_qualifiche ON      tbl_rel_tesserato_discipline_societa.id_qualifica = tbl_qualifiche.idtbl_qualifiche
    INNER JOIN tbl_discipline ON      tbl_rel_tesserato_discipline_societa.id_disciplina = tbl_discipline.idtbl_discipline
    INNER JOIN tbl_societa ON      tbl_rel_tesserato_discipline_societa.id_societa = tbl_societa.idtbl_societa
    LEFT JOIN tbl_province ON tbl_societa.provincia_sede_sociale = tbl_province.idtbl_province
    LEFT JOIN tbl_comuni ON tbl_societa.comune_sede_sociale = tbl_comuni.idtbl_comuni
    LEFT JOIN tbl_rel_tesserato_discipline_praticate ON tbl_rel_tesserato_discipline_praticate.tessera_id=
    tbl_rel_tesserato_discipline_societa.idtbl_rel_tesserato_discipline
    LEFT JOIN tbl_discipline_praticate ON tbl_discipline_praticate.idtbl_disciplina_praticate=tbl_rel_tesserato_discipline_praticate.disciplina_praticata_id
    WHERE
    tbl_tesserati.cognome LIKE ?
    AND tbl_tesserati.nome LIKE ?
    AND tbl_rel_tesserato_discipline_societa.id_societa LIKE ?
    AND tbl_tesserati.idtbl_tesserati LIKE ?
    AND tbl_cariche.idtbl_cariche LIKE ?
    AND tbl_qualifiche.idtbl_qualifiche LIKE ?
    AND tbl_tesserati.data_nascita >= ?
    AND tbl_tesserati.data_nascita<= ?
    AND tbl_discipline.idtbl_discipline LIKE ?
    AND codice_affiliazione LIKE ?
    AND tbl_societa.denominazione LIKE ?
    AND YEAR(tbl_rel_tesserato_discipline_societa.data_scadenza) LIKE ?
    AND (tbl_province.nome LIKE ? OR tbl_province.nome IS NULL)
    AND ( tbl_comuni.nome LIKE ? OR tbl_comuni.nome IS NULL)
    The tbl_tesserati.data_nascita is a mysql date field.
    The click event handler code for the "Details" Button is:
    public String btnModificaTesserato_action() {
            try{
                TableRowDataProvider rowData= (TableRowDataProvider)getBean("currentRowTesserati");
                getRequestBean1().setId_tesserato((Long)rowData.getValue("idTesserato"));          
            } catch(Exception ex) {
                log("errore nella query",ex);
            return "dettaglioTesseratoSocieta";
        }When i run the project and open the page the table is correctly rendered and populated with some rows. But when i click on details button nothing happens, the page is simply reloaded.
    If i set a breakpoint in the code line   TableRowDataProvider rowData= (TableRowDataProvider)getBean("currentRowTesserati");the debbuger does not stop the code execution ! As if the button was never clicked!
    I tried to modify the source query to :
    SELECT tbl_tesserati.idtbl_tesserati idTesserato,
    tbl_tesserati.num_tessera,
    tbl_tesserati.nome,
    tbl_societa.codice_meccanografico
    FROM tbl_tesserati
    INNER JOIN tbl_rel_tesserato_discipline_societa ON tbl_tesserati.idtbl_tesserati = tbl_rel_tesserato_discipline_societa.id_tesserato
    INNER JOIN tbl_cariche ON      tbl_rel_tesserato_discipline_societa.id_carica = tbl_cariche.idtbl_cariche
    INNER JOIN tbl_qualifiche ON      tbl_rel_tesserato_discipline_societa.id_qualifica = tbl_qualifiche.idtbl_qualifiche
    INNER JOIN tbl_discipline ON      tbl_rel_tesserato_discipline_societa.id_disciplina = tbl_discipline.idtbl_discipline
    INNER JOIN tbl_societa ON      tbl_rel_tesserato_discipline_societa.id_societa = tbl_societa.idtbl_societa
    LEFT JOIN tbl_province ON tbl_societa.provincia_sede_sociale = tbl_province.idtbl_province
    LEFT JOIN tbl_comuni ON tbl_societa.comune_sede_sociale = tbl_comuni.idtbl_comuni
    LEFT JOIN tbl_rel_tesserato_discipline_praticate ON tbl_rel_tesserato_discipline_praticate.tessera_id=
    tbl_rel_tesserato_discipline_societa.idtbl_rel_tesserato_discipline
    LEFT JOIN tbl_discipline_praticate ON tbl_discipline_praticate.idtbl_disciplina_praticate=tbl_rel_tesserato_discipline_praticate.disciplina_praticata_id
    WHERE
    tbl_tesserati.cognome LIKE ?
    AND tbl_tesserati.nome LIKE ?
    AND tbl_rel_tesserato_discipline_societa.id_societa LIKE ?
    AND tbl_tesserati.idtbl_tesserati LIKE ?
    AND tbl_cariche.idtbl_cariche LIKE ?
    AND tbl_qualifiche.idtbl_qualifiche LIKE ?
    AND tbl_tesserati.data_nascita >= ?
    OR tbl_tesserati.data_nascita<= ?
    AND tbl_discipline.idtbl_discipline LIKE ?
    AND codice_affiliazione LIKE ?
    AND tbl_societa.denominazione LIKE ?
    AND YEAR(tbl_rel_tesserato_discipline_societa.data_scadenza) LIKE ?
    AND (tbl_province.nome LIKE ? OR tbl_province.nome IS NULL)
    AND ( tbl_comuni.nome LIKE ? OR tbl_comuni.nome IS NULL)
    Using this query everything works well !! The click handler works and the debugger too !!
    I changed only the AND in OR !!!
    I also tried to change mysql-x-x-connector driver but without solving my problem.
    Can someone help me ?
    Thanks
    Giorgio

    You'll find that it is more to do with the way MySql deals with dates than anything else! Depending on how your date field is setup, then try using a BETWEEN statement for those 2 lines in your first query e.g.
    AND ( tbl_tesserati.data_nascita BETWEEN ? AND ?)
    The date column needs to be in the ISO format to work. If you examine your second query output, you might discover that the output is only going to refer to one parameter (probably the OR one). Did you manage to view the output logs from the application server? You would have got an idea from there with a message like stating a conversion error'.
    Alternatively, you could try using the to_days() function and convert it directly to a number which would be a lot easier to deal with. For example:
    AND to_days(tbl_tesserati.data_nascita >= ? )
    AND to_days( tbl_tesserati.data_nascita<= ? )
    Or try the BETWEEN version with to_days() and see what you get.
    More info about date formatting (v5) here:
    http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_to-days
    Before I forget, sometimes you may need to treat dates as Strings rather 'Long' as you did.
    As a matter of interest, did you try your query in a different piece of software?
    If my queries are a little more complicated, I tend to try MySql queries out in the free MySql query browser and also double check in another to verify certain issues. I found it easier to develop SQL in a seperate program then import the final version to JSC making the required modifications for parameters.
    Message was edited by:
    aerostra

  • Include Button that executes PL/SQL procedure to SQL query based region

    I would like to add two columns to a SQL query region.
    These columns would not be sourced from the query, but rather would be used to execute a PL/SQL procedure.
    For example, I would like to have a manager approve or deny adding an additional employee to the department.
    There would be one button for APPROVE. And, one button for DENY.
    The PL/SQL procedure would execute to perform the required DML based upon the selected action (either APPROVE or DENY).
    A sample output would look like this:
    <APPROVE>, <DENY>, John Doe, Accountant
    <APPROVE>, <DENY>, Jane Doe, Accountant
    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?
    Thanks!
    -Reid

    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?Conditional page item? You can associate processes with buttons on a page

  • Executing SQL query in portal database

    Hi ,
       I wish to do a simple POC . I need to create a table from NWDS , populate it with some data and then access the table data using an sql query . I am aware how to create a table but I am not sure where exactly to write the query .
    What I would like to understand is
    1) If I create a table where would that table get created (The database) ?
    2) Where would I write that query in NWDS ?
    3) How would I execute that query in that database ?
    Please help for the same .
    (Needless to say that I always award points )
    Regards
    Deepak Singh

    Hi Gopal ,
       Thanks for the reply .This is what I did . I am pasting the whole code of the class that I am using to do the POC .
    package com.gravity;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    /*import sun.jdbc.odbc.ee.DataSource;/
    @author Administrator
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class DataHandling {
    public static void DataPost(){
         Connection con = null ;
         try {
    Added code
            Hashtable env = new Hashtable();
              env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              System.out.println("initial_context_factory put ");
              env.put(javax.naming.Context.PROVIDER_URL, "gms29:50004");
              System.out.println("provide_url put ");
              env.put(javax.naming.Context.SECURITY_PRINCIPAL, "j2ee_admin");
              System.out.println("security_principal put ");
              env.put(javax.naming.Context.SECURITY_CREDENTIALS, "gravity");
              env.put("domain", "true");
              env.put("force_remote", "true");
              System.out.println("security_credentials put ");
              InitialContext iCtxt = new InitialContext(env);
              System.out.println("Object made for initial context ");
              DataSource ds = (DataSource) iCtxt.lookup("jdbc/my_db");
              System.out.println("Datasource obtained ");
              try {
                   con = ds.getConnection();
                   Statement stmt = con.createStatement();
                        String query1 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('naveen',125188)";
                        String query2 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('deepak',125189)";
                        String query3 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('rajeev',125190)";
                   stmt.executeUpdate(query1);
                   stmt.executeUpdate(query2);
                   stmt.executeUpdate(query3);
                  }catch (Exception e) {
                   e.printStackTrace();
             }catch (Exception e) {
                    e.printStackTrace();
                                         } finally {
                                            try {
                                            con.close();
                                                }catch (Exception e) {
                                                e.printStackTrace();
    public static void main (String[] args){
         System.out.println("Hello");
         DataPost();
    I have imported all the driver jar files and sapj2eeclient.jar in the classpath .
    Also the drivers found in the path
    172.16.161.11\usr\sap\EP1\DVEBMGS00\j2ee\cluster\server0\bin\ext\com.sap.portal.jdbcdrivers
    have all been added to the classpath .(Not sure if this is required)
    Let me know what you find wrong in my code and in the meanwhile I will try to implement what you suggested .
    Regards
    Deepak Singh

  • How to find last executed query on database and or schema.

    hi,
    how to find last executed query on database and or schema.
    yours sincerely

    Sessionwise if you wanna see means use v$session.. Because it will show execution time also so you can analyze it easily and get sql based on SID and serial number ..
    Try :
    select * from v$session;
    Regards..

  • Navigate to pressed button in multirecord block

    Hi,
    I'm using Forms 6i (6.0.8.27.0), Client / Server.
    I have a multi-record block with a button ("+") in the block for duplicating the record and increasing the date.
    So each row has a "+" button.
    When I press the "+" eg. on the 3rd row I want to navigate to this row and to execute the code in when-button-pressed trigger.
    So I wrote in the when-button-pressed trigger
    "GO_RECORD(:system.mouse_record);
    duplicate_record;
    Unfortunately :system.mouse_record is set to 1, also :system.cursor_record and :system.trigger_record.
    The "Mouse Navigate" property of the button is set to "yes".
    I have used the search function but didn't found a solution.
    Thanks in advance,
    Marco.

    Marco,
    My apologies, I should learn to read all of the message. I am embarrassed into having another try.
    Firstly, to clarify
    I am using Forms10g (sorry but it was the only one I could remove a developer from)
    Duplicate_Record: Copies the value of each item in the record with the next lower sequence number to the corresponding items in the current record. The current record must not correspond to a row in the database. If it does, an error occurs.
    I have setup a default block with a button on it and to test I have just executed a query against the block.
    After rows have been retrieved
    When I click on a button system.mouse_record always returns 0 (In the help it says this will be the case if you are not in an item, but I do not know if a button is classed as an item in the eyes of the help test author, I thought it might be, but maybe they mean a text item?) when I use :system.trigger_record I always get the right record number.
    For duplicate_record to work I have to be in a "NEW" record. I appear to be able to do this in two ways.
    Go to the bottom of my records + 1. The button becomes enabled and when I press it I can duplicate the record above.
    I can choose "insert record" (key-crerec I think or create_record) if I do this I can then press the button and duplicate the record above into this new record.
    If I press a button on a record which already has a record I presume of type QUERY then when I press the button I get FRM-41802 duplicate record function allowed on new records only.
    If I do not perform a query in the block; I create the first record input data I have to move to the next record to enable the button
    If I press the button it duplicates the value in the first record
    If I change the value in the second record and then go back to the first and press the button on the second row it overwrites the value with the value from the first row
    I hope this gives you some pointers in solving your problem.
    Apologies again for not reading properly and I hope that my using 10g has not made all this info useless.

  • Conversion of Mysql query in oracle acceptable query format

    Hi
    I have successfully converted my MySql database in oracle. Now the problem is how to execute already written hundreds of Mysql query on the oracle. There are many syntax variation in Mysql query format which is not acceptable for oracle.
    For Example
    Select case_id as 'this is alias' from cases
    The above query can run on Mysql database but have problem while executing Oracle, because single quotes should be replaced with double quotes before executing it on oracle. There are also many other syntax conflicts.
    I have tried to resolve the problem through SwisSQLAPI but problem still exist as SwisSQLAPI is not dealing with all syntax conflict. In my case (select if (expresion, true,false)) must be replace with decode (expression, value,true,false) function of oracle and this conversion is not supported by SwisSQLAPI.
    Please help me in resolving this problem
    Thanks

    The problem with trying to port from one language (mysql SQL) to another (oracle SQL) is that there's generally no hard rules for a computer to follow, that it will get it 100% correct.
    Look at babelfish when you translate a foreign language to English. The end result is readable (usually), but it's rarely completely correct.
    The problem is when you feed something into Oracle SQL, it needs to be 100% correct.
    All you can really do here is rewrite these queries. It shouldn't actually take as long as you think, because 50% of queries will generally need very minor changes you can do in a minute, and 25% won't need any changes at all.

  • Is there a way to force a View Object to query the database always?

    Dear All,
    Is there a way to force a view object to always scan the database table to read the latest data?
    Here's my use case.
    I have a page that loads data then I have a button which executes the following code.
    viewObject.setApplyViewCriteriaName("SampleCriteria");
    viewObject.setNamedWhereClauseParam("arg1", "test");
    viewObject.executeQuery();
    RowSetIterator it = viewObject.createRowSetIterator(null); 
    while(it.hasNext()) {
         /* More Code */
    }Suppose after page load, I edited some row in the table and then I clicked the button. I notice that my edited row
    was not reflected in the query.
    I am not sure but is there some configuration to check so that when the viewobject executes it will always query the data
    from the table?
    I am thinking that there is some level of caching and I want to disable it. If I restart my application, I notice that it is able to read the latest data.
    JDEV 11.1.1.5

    By default a view object performs its query against the database to retrieve the rows in its resulting row set. However, you can also use view objects to perform in-memory searches and sorting to avoid unnecessary trips to the database.
    The view object's query mode controls the source used to retrieve rows to populate its row set. For more details please refer: http://docs.oracle.com/cd/B31017_01/web.1013/b25947/bcadvvo005.htm
    Also, see if this helps: setQueryMode for secondary rowSet not working

  • Can I set an af:setActionListener on the search button of a af:query ?

    Hi,
    I want to store a flag in the session scope when the search button of an <af:query> form is pressed. The flag is used to determine if the query has been executed and the result table iterator should provide the result.
    I'm still looking for a solution to handle the problem of an automatic query execution when a search page is rendered (see How to execute query only when user submits request in <af:query>
    And the solution should work without Java code. :-)
    Thanks,
    Markus

    Hi Frank,
    thats a tough question. I have some opinions on how to implement it:
    1.) Exposing listeners
    Easy (?!) solution, needs managed beans as listeners.
    2.) Exposing the commands. Make the commands like 'search', 'reset', 'save' ... accessible by creating extra JSF code for the commands in a facet when D&D the <af:query>.
    I don't know if it is possible to implement such a solution, but the developer can extend or adapt easily the behavior to his own needs.
    3.) Implement result of a D&D of a named criteria as a series to single JSF components. Each component implements an aspect of the <af:query> component.
    Markus

Maybe you are looking for

  • Using Shared Variables and Initialize Front Panel Binding (to PSP)

    Hi, I use LV DSC RT 8.2.1 I have a Vacuum System That includes signals from - Pumps failure, Valves status, Vacuum gauge, start Pump ... Each signal is read by a FieldPoint.  All the relevant FieldPoint Channels are read by the Server (a computer in

  • Monthly Photo Stream project in iCloud Photos?

    Hi, As in Aperture, which gives me a monthly summary for each months Photo Stream and makes it a project, does Photos have the same functionality? Thanks

  • How to reinstall the mac app store after an accidental removal?

    I have a real problem, and I could use anyones help. I am running Mac os x 10.6.8 and was trying to to upgrade to lion, however I was experiencing issues with the mac app store and had to delete, not in the knowledge that I cannot download the combo

  • Need a little help please. Three questions...

    I just got iLife 08 (never used it before) and have updated my old website which was on a personal domaine host (www.dpkmusic.com) and has been up for a few years now... What did is publish my new iWeb site to a folder (to my existing website local f

  • Itunes library gone after update

    After update, iphone crashed and itunes defaulted to a restore mode. After restore, no itunes library on the iphone (normal), but the recent sync to my computer library is now empty! I have "previous libraries" on the computer, but none include the m