简体   繁体   中英

How to pass java object to mysql stored procedure

I need to validate all values from the master tables by the service call in java. But it takes more time for execution. So I planned to do the task on the MySQL stored procedure.

For Example:

I have a POJO class called User

User user = new User();
user.setId(1);
user.setName("name");

Can I pass the user java object to MySQL stored procedure?

No, we can't pass a java object as a parameter to a MySQL stored procedure.

A MySQL stored procedure can have zero, one or more scalar parameters. Arguments are simple datatypes such as DATETIME, DECIMAL, INT, VARCHAR, et al.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM