| | |
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.
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
0
#2 6 Days Ago
•
•
•
•
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.
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);
I am having the same problem as well. There doesnt seem to be a lot of stuff on the internet regarding "triggers from Java"
![]() |
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: Custom cell renderer rendering before all results returned from query
- Next Thread: Build method for a tree
| Thread Tools | Search this Thread |
6 actuate android api applet application applications array arrays automation balls bank binary bluetooth bold business c++ chat class clear client code codesnippet collections component coordinates database defaultmethod development dice doctype dragging ebook eclipse educational error file formatingtextintooltipjava fractal froglogic game givemetehcodez graphics gui hql html ide ideas image infinite ingres integer intersect invokingapacheantprogrammatically j2me java javaexcel javaprojects jni jpanel jtextarea julia linux list map method methods mobile mysql netbeans openjavafx parameter php problem program programming project recursion repositories scanner scrollbar sell server set sms sort sorting sql sqlserver state storm string sun superclass swing swt threads tree websites windows






