-
Java and PL SQL
Hi guys, I'm trying to figure out how can I catch an error validating data in MySQL
So basically my MySQL trigger says:
Code:
Begin
If new.string="" then // string carries the content of a JtextField
// return an error string
Else
// insert into MySQL the data
End
So I want to know if the string in my insert sentence is empty, how can I return a message with a simple System.out.print that indicates to the user that in order to proceed he needs to fill the field in his form.
Knowing this basic example I'll be able to create complex ones, thanks in advance!
-
Re: Java and PL SQL
Not a Java question. Moving to Forum Lobby.
db
-
Re: Java and PL SQL
My bad I'm sorry, won't happen again :)
-
Re: Java and PL SQL
From stackoverflow.
You want the RuiDC one, using signal...presuming you are on 5.5+.
That should throw a sql error up to the calling SQL and on to Java.