• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

deleting from database(simple)

 
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
my site is in JSP + mySQL
customer can join to the site through membership form.
i want to remove a customer from my database if he is not purchasing any items within 7 days.
how to achieve this?..i think this can be done with a database Trigger.but mySQL does'nt support Triggers.so what will be the possible solution?.
this is a common problom.i think most coders may have done this before.becoz i hav seen this in most websites.
thanks in advance
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This hasn't much to do with JSP per se, so I'm moving it along to the JDBC forum.
bear
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Murasoli,
You could have a java class that uses jdbc to run the delete query. Set up a java thread (or batch process) to run this however often you would have had the trigger run.
 
Murasoli Maran
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne,
can u tell me how to make a batch jon in winXP?.i heard abt cruntab ..but i donno how to use it.
my query is
delete from table1;
i wanna run this script in every 6 AM.
do u giv me an example?.plz share ur exp.
thanks
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Murasoli,
Crontab is for UNIX. For Windows, you have to use windows scheduler. The third post on this page describes the details. In the scheduler entry, you would run:
>java ProgramToDeleteFromDatabase
I assume you have a where clause in the delete query? You just write up a small program (with a main method) that uses JDBC to run the query. The code should look just like your JDBC code in the regular application.
 
Murasoli Maran
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks u very much Jeanne..good help to me..
 
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic