| | |
Create trigger mysql5 with java
![]() |
•
•
Join Date: Apr 2007
Posts: 34
Reputation:
Solved Threads: 1
Hi,
how to create trigger in mysql 5 with java.
i have code like this, but still error "
java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER $$ CREATE TRIGGER `a1`.`xData` AFTER UPDATE ON `a1`.`tinfo`IF (' at line 1 "
thanks.
how to create trigger in mysql 5 with java.
i have code like this, but still error "
java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER $$ CREATE TRIGGER `a1`.`xData` AFTER UPDATE ON `a1`.`tinfo`IF (' at line 1 "
thanks.
Java Syntax (Toggle Plain Text)
SQL=""; SQL="DELIMITER $$ "+ "DROP TRIGGER `a1`.`xData` || "+ "CREATE TRIGGER `a1`.`xData` AFTER UPDATE ON `a1`.`tinfo`" + "FOR EACH ROW BEGIN " + "IF (OLD.Name <> NEW.Name) THEN " + "INSERT INTO tlog (remark) VALUES ('EditData'); " + "END IF; " + "END;" + "$$" + "DELIMITER;"; stmt=con.createStatement(); rs=stmt.execute(SQL);
Last edited by onsir; Sep 3rd, 2007 at 5:15 am.
![]() |
Similar Threads
- creating an instant messenger program in java (Java)
- Create an Access Database using Java (Java)
- Create own ports (Java)
- Java Problem (Windows NT / 2000 / XP)
- Java Executable? (Java)
- I need a good java compiler (Java)
- graph in java (Java)
- Java, /tmp file (Java)
Other Threads in the Java Forum
- Previous Thread: compiler java help
- Next Thread: Financial Information eXchange (FIX) protocol
| Thread Tools | Search this Thread |
911 addball addressbook android api applet application apps array automation awt binary bluetooth businessintelligence busy_handler(null) button card class client code collision component constructor crashcourse css csv database draw eclipse ee error eventlistener exception fractal free game gis givemetehcodez graphics gui html ide image integration j2me japplet java javaarraylist javadoc javafx javamicroeditionuseofmotionsensor javaprojects jni jpanel jtree julia jvm linux loan map method migrate mobile netbeans objects oracle oriented phone physics plazmic problem program programming project projects radio recursion replaydirector reporting scanner se server service set sharepoint smart sms software sortedmaps sql swing test textfield threads tree trolltech ubuntu unlimited utility windows





