PL/SQL Programming-Stored procedures

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.