Link to home
Start Free TrialLog in
Avatar of skn73
skn73

asked on

java data structure into stored procedures

Is it possible to pass Java data objects to  stored procedures?

I have a stored procedure framework that accepts in parameters and returns ouput..but now ..I have a huge data structure of 150 fields to be passed in as input parameters which makes it impossible to type all that in the SP as input.. How do I do this?

Avatar of cavey_79
cavey_79

Quick answer...you can't. You will probably need to create a single value (like a huge comma separated string) that you would pass into the stored procedure.
Then, in the stored procedure, you would parse it and split it into little pieces.

You can also try having 150 parameters to the stored proc, however that might be a problem with some databases that will limit the number of parameters to a stored proc.
Avatar of Mayank S
Even if it is possible, its not advisable either because then you limit yourself to only those databases which support Java objects. You won't be able to port or migrate to other databases. I would say keep the application layer generic of the database and let the DAO layer communicate with the database using stored procedures by passing data in the form of whatever complies with plain SQL specifications
Avatar of skn73

ASKER

I dont agree its not possible at all .. there should be some way ..
ASKER CERTIFIED SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial