我已经在基于oracle数据库的PL/SQL工具上创建了表 
表中已经存在一条记录用户名和密码(通过预定义的用户信息表判断用户输入是否有效) 
现在我要怎么写一个存储过程来判断用户名和密码已经存在数据库中??? 

解决方案 »

  1.   

    楼主先从create or replace procedure 学习吧
      

  2.   

    jdbc可以实现,写一个方法把条件做为参数传进去,用这个参数来搜索,根据结果来判断是否为你想要的数据 
      

  3.   

    小心sql注入,这么点事还写存储过程,
      

  4.   

    这么点事还写存储过程?
    select username from userInfo where username='admin'
      

  5.   

    --t.name t.pwd
    create or replace package head as 
    begin
    function checkLogon(uname t.name%type, upwd t.pwd%type) return boolean;
    end;
    /
    create or replace package body as begin
    function checkLogon(uname t.name%type, upwd t.pwd%type) as
    temp number(1);
    begin
      select 1 into temp from t where name=uname and pwd=upwd;
      return true;
    exception
      when no_data_found then
        return false;
    end;