Sql> Create or Replace procedureSp_pro3 (name_invarchar2, id_invarchar2) is 2 begin 3 UpdateMyTestSetName=Name_inwhereId=id_in; 4 End; 5 / Procedurecreated SQL> execSp_pro3 ('NewName','1') PL/Sqlproceduresuccessfully completed SQL> Select * frommytest; NAME PASSWD ID------------------------------ ------------------------------ --NewName123456 1Li Chao2222 2Xiao Wang1222 3
Calling Oracle's stored procedures in Java code
Public Static voidMain (string[] args) {//TODO auto-generated Method Stub Try { //1. Load DriverClass.forName ("Oracle.jdbc.driver.OracleDriver"); //2. Get ConnectedConnection ct=drivermanager.getconnection ("JDBC:ORACLE:THIN:@127.0.0.1:1521:ORCL", "System", "rqyz2618"); //3. Create CallableStatementCallableStatement Cs=ct.preparecall ("{Call Sp_pro3 (?,?)}"); //4. Assigning Values toCs.setstring (1, "Gaodingle!!!!"); Cs.setstring (2, "2"); //5. ImplementationCs.execute (); //6. CloseCs.close (); Ct.close (); } Catch(Exception e) {//Todo:handle ExceptionE.printstacktrace (); }at this point there will be a problem is to take JDBC to connect the time will be reported invalid Username/password; logon deniedbut you in the SQL developer landing time is not a problem, and finally found that because the user type, before the type of SYSDBA, and after using the JDBC connection is the default normal login so back to the problem of landing, Create a new normal user oralter user XXX identified by XXXdo the following, do not need to change the password, the original user, the original password on the lineNormal user Sysoper database operator, mainly including open database server, shut down database server, backup database, recover database, log archive, session limitSysDBA database administrator, open database server shut down database server, back up database, recover database, log archive, session limit, management function, create dataGeneral programmers use normal mode The problem is also the reason why Dbvisualizer never landed.
PL/SQL Programming-Stored procedures