cancel
Showing results for 
Search instead for 
Did you mean: 

Prepared Stmt execution is failing with auto genrerated keys option

Former Member
0 Kudos

Dear Experts

I am executing a prepared statement with auto generated keys set.

It looks like following. Actually im trying to get the auto generated keys after the execution of prepared statement . But it is failing.

String query= "INSERT INTO AlertMessage WITH(ROWLOCK) (Message) VALUES (?)";

PreparedStatement pstmt = null;

pstmt= connection.prepareStatement(query, PreparedStatement.RETURN_GENERATED_KEYS);

pstmt.setString(1, "Suresh testing ");

int i = pstmt.executeUpdate();

Error that I am getting is given below and I am using datsource configured through JDBC connector service to get the database connection.

java.lang.AbstractMethodError: com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement;

Exception id: [001438BD95D9003E00000051000012AC000458318FF1FC64]

Could you pls. provide any suggestions or solutions to this.

Thanks in advance,

With best regards,

Suresh.

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Suresh,

The method Connection.prepareStatement(String sql, int autoGeneratedKeys) is available since JDK 1.4. However, NetWeaver 2004 / 7.0 is source compatible with JDK 1.3, so I'm afraid you can't use this feature here.

One option you could consider is switching to NW CE 7.1 which is Java SE / EE 5 compatible.

HTH!

\-- Vladimir

Former Member
0 Kudos

Hi Vladimir,

Thanks for your reply.

We are using Netweaver 2004/ 6.4. The recommended jdk version is jdk 1.4. We are using the same as application server jvm and for application development.

Thanks,

With best regards,

Suresh.

Vlado
Advisor
Advisor
0 Kudos

Please read carefully my reply. NetWeaver 2004 runs with JDK 1.4 but is source compatible only to JDK 1.3. So you can use only JDK 1.3 APIs with it.

Regards,

Vladimir

Former Member
0 Kudos

I could able to run the same with my own data base connection. But I could not able to run with connection obtained from JDBC connector service of Net weaver application server. Both the cases application is deployed in same application server.

I am confused. You mean to say that any services from NW application server gives support to only JDK 1.3 apis?

Pls. let me know .

Thanks,

With best regards,

Suresh.

Vlado
Advisor
Advisor
0 Kudos

Yes, NetWeaver 2004 / 7.0 supports only JDK 1.3 APIs.

Former Member
0 Kudos

Thanks for your reply.

Could you tell me which version is compatible with jdk 1.4?

Also what is the latest version and its JDK version?

Thanks,

With best regards,

Suresh

Vlado
Advisor
Advisor
0 Kudos

Hi Suresh,

I already wrote this in my first reply: [NW CE 7.1|https://www.sdn.sap.com/irj/sdn/nw-ce-downloads] is Java SE / Java EE 5 compatible, which of course means also J2SE / J2EE 1.4 compatible.

Regards,

Vladimir

Former Member
0 Kudos

Thanks Vladimir

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear experts,

Any suggestions to my post?

Appreciate your reply.

Thanks in advance.

With best regards,

Suresh.