Hello, I m confusing with CallableStatement interface... I know stored procedure with IN parameters but i don't know OUT parameters and even i do know the logic of stored procedure and the program too...
MyDoubt : STORED PROCEDURE
1. Will this stored procedure work with mysql?
2. What is the logic of this stored procedure ? (it copies the USERNAME, CREATED_BY,CREATED_DATE column and then inserted into o_username,o_createdby,o_date but i do know from which table to another table ?)
3. what is this ? (DBUSER has username column with some datatype right ?)
MyDoubt : JDBCJAVA PROGRAM
1.What is the flow of execution of this program ? ( it returns username,createdby,createddate in the form of specified datatype by giving id = 10 so that it retrieves "username,createdby,createddate values.... is this right?)
MyDoubt : TABLE CREATION
1.How many tables should i want to create ? One or Two table ?
Please anyone help me............. Thanks in advance
1. It looks like Oracle syntax to me. It will definitely work with MySql but syntax has to be changed.
To check how syntax goes in MySql follow this link
2. It does not insert into any other table. It selects the column values and assigns them to the mentioned variables.
In the above PlSql statement, value of USERNAME column is assigned to o_username variable, CREATED_BY to o_createdby variable and so on which are declared while creating the stored procedure.
3. This is Oracle syntax and I guess does not work with MySql.
This statement tells MySql to declare a variable p_userid of type USER_ID column from DBUSER table.
So if USER_ID is a VARCHAR(20), the variable p_userid will be VARCHAR(20).
Flow of execution of JDBC program:
It initializes Statement to call the Stored Procedure.
It passes user id to the Stored Procedure as input parameter.
It gets user name, created by and created date as output parameters from Stored Procedure and prints them.
For this specific code, you have to create only 1 table, i.e., DBUSER.