Hi all!
My problem is very, very silly and stupid, I know, don't blame me for
that please...
When I call my query from SQL*Plus, I get the correct result:
SELECT check_passwd('u ser', 'password') FROM dual;
CHECK_PASSWD('U SER','PASSWORD' )
---------------------------------------
1
Now I need to to the same thing from java program, so I wrote the
following test:
Statement stmt = dbm.getConnecti on().createStat ement();
ResultSet rs = stmt.executeQue ry("SELECT check_passwd('u ser','password' )
FROM dual");
assertTrue(rs.n ext());
assertTrue(rs.g etInt(1) == 1);
....
However, the second assertion fails! rs.getInt(1) returns "0"!
check_passwd is the function that returns integer, either 0 or 1.
BTW, the same thing happens when I use PreparedStateme nt and setString()
instead of directly stuffing username and password into the query.
I'm porting the code from PostgreSQL to Oracle, and in Postgres
everything worked perfectly, so ... any ideas?
Thanks in advance!
--
Maxim Slojko
My problem is very, very silly and stupid, I know, don't blame me for
that please...
When I call my query from SQL*Plus, I get the correct result:
SELECT check_passwd('u ser', 'password') FROM dual;
CHECK_PASSWD('U SER','PASSWORD' )
---------------------------------------
1
Now I need to to the same thing from java program, so I wrote the
following test:
Statement stmt = dbm.getConnecti on().createStat ement();
ResultSet rs = stmt.executeQue ry("SELECT check_passwd('u ser','password' )
FROM dual");
assertTrue(rs.n ext());
assertTrue(rs.g etInt(1) == 1);
....
However, the second assertion fails! rs.getInt(1) returns "0"!
check_passwd is the function that returns integer, either 0 or 1.
BTW, the same thing happens when I use PreparedStateme nt and setString()
instead of directly stuffing username and password into the query.
I'm porting the code from PostgreSQL to Oracle, and in Postgres
everything worked perfectly, so ... any ideas?
Thanks in advance!
--
Maxim Slojko
Comment