cancel
Showing results for 
Search instead for 
Did you mean: 

Oracle Pool Connection problem

Former Member
0 Kudos

Hello.

I am experiencing a problem trying to retrieve data from an oracle database.

I am using ep6 sp2 and have set up a connection pool using the com.sap.portals.jdbc.oracle.OracleDriver as a driver.

The problem is that when trying to get a connection that my service can use (in the java code), I keep receiving this error message:

java.sql.SQLException: [SAP_Portals][Oracle JDBC Driver]No more data available to read.

The error appears to come from the Statement initialization with con.createStatement() in the code.

Anyone has any idea of what I might be doing wrong?

Thank you in advance.

Silviu.

Accepted Solutions (1)

Accepted Solutions (1)

guru_subramanianb
Active Contributor
0 Kudos

Hi,

If you are sure that the connection has been established from your portal to oracle DB, then I think you have problem with the query you are using.Did you by any chance try to run your query alone in oracle backend directly and saw what's happening?Or if your query is correct whether did you check whether you have data in the table?

Hint :- Put a system.out.println("some msg"); after each & every line in your DB conection in ur try block.I mean after creation of connection,initilization of statement etc.This way also you can figure out where the problem is...

Hope these info helps.

Regards,

Guru

Former Member
0 Kudos

Hello again, and thanks for the answer.

Yes, I did run the query directly into my oracle backend. It works just fine (it's a very simple insert query).

I already put the system.out lines, that is why I said that the error appears to be at statement initialization (when I do Statement stat = con.createStatement(); where con is the db connection).

To be more clear, I have lines like (i am using a logger instead of the system.out, but this example is close enough; ds is a datasource object):

system.out.println("check 0. trying to establish con");

Connection con = ds.getConnection();

system.out.println("check 1. con : "+con);

Statement stat = con.createStatement();

system.out.println("check 2. stat : "+stat);

stat.executeQuery("insert into testtable(id, name) VALUES('asdadsad','asdasdasds')");

system.out.println("check 3. query ok");

In the above, the "check 2....." line does not appear, but the "check 1...." line does. Hence, I think the error is at statement initialization.

I know the code is very childish, but this is just for testing purposes, and it should work... right?

Please tell me if any ideas cross your mind.

Thank you again.

Silviu.

Answers (5)

Answers (5)

guru_subramanianb
Active Contributor
0 Kudos

Hi,

wht is the oracle driver ur using and the driver class files in ur "lib" folder?

Rdgs,

Guru

guru_subramanianb
Active Contributor
0 Kudos

One more thing jus to check urself.I find you are inserting string for column id.Did you declare the column id as string or intin your Oracle DB.Jus check it also.

-Guru

Former Member
0 Kudos

Hi again.

The id is string. As I said, the query runs fine in the oracle backend.

The Connection and Statement are of course java.sql.Connection and java.sql.Statement.

I switched to executeUpdate. No good, same error.

I do not think the code is the problem. I think maybe some connection pool settings I have to make in the portal, or maybe the oracle drivers in the portal are not compatible with the oracle db... I just thought someone had experienced this problem, cause I would like to have a clue of where to start looking...

Thank you anyway.

Silviu.

guru_subramanianb
Active Contributor
0 Kudos

One more thing jus to check urself.I find you are inserting string for column id.Did you declare the column id as string or intin your Oracle DB.Jus check it also.

-Guru

guru_subramanianb
Active Contributor
0 Kudos

Hi again,

I see no problem with your code.

Jus a hint:-

Try java.sql.connection,java.sql.statement instead of connection & statement.

Instead of stat.excuteQuery try stat.executeUpdate("...");

Hope it works this time for you.

Regards,

Guru

guru_subramanianb
Active Contributor
0 Kudos

Hi,

If you are sure that the connection has been established from your portal to oracle DB, then I think you have problem with the query you are using.Did you by any chance try to run your query alone in oracle backend directly and saw what's happening?Or if your query is correct whether did you check whether you have data in the table?

Hint :- Put a system.out.println("some msg"); after each & every line in your DB conection in ur try block.I mean after creation of connection,initilization of statement etc.This way also you can figure out where the problem is...

Hope these info helps.

Regards,

Guru