What is the SQLException that you are getting? That should tell you exactly
what the problem is.
Gregg Wonderly
ankur572 wrote:
> hiiiiii
>
> i write a function for login when i write this code then it is not working
>
>
>
> java.lang.String sql="{call login_action(?,?)}";
>
> java.sql.DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
>
> java.sql.Connection cn=java.sql.DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "scott", "matrix");
>
> java.sql.CallableStatement cs=cn.prepareCall(sql);
>
> System.out.println(cn+" "+user+pass);
>
> cs.setString(1, user);
>
> cs.setString(2, pass);
>
> java.sql.ResultSet rs = cs.executeQuery();
>
> while(rs.next())
>
> {
>
> System.out.println(rs.getString(1));
>
> }
>
>
>
>
>
> while this code is working--------------
>
> java.lang.String sql="select login_action(?,?) from dual";
>
> java.sql.DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
>
> java.sql.Connection cn=java.sql.DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "scott", "matrix");
>
> java.sql.CallableStatement cs=cn.prepareCall(sql);
>
> System.out.println(cn+" "+user+pass);
>
> cs.setString(1, user);
>
> cs.setString(2, pass);
>
> java.sql.ResultSet rs = cs.executeQuery();
>
> while(rs.next())
>
> {
>
> System.out.println(rs.getString(1));
>
> }
>
>
>
>
>
> difference is only bold text part...............can you please tell me the exact way to call oracle function from java.......or any other way within netbeans .............or any specific driver that needed...........whatever
>
> i will appreciate your reply................................................... thank you.................
>
>
>
>
>
>