cancel
Showing results for 
Search instead for 
Did you mean: 

Question about JDBC

Former Member
0 Kudos

Dear all,

I am trying to connect an external MSSQL Database in my custom iView. I know that it is necessary to make this through a JDBC. But is there any JDBC followed in the EP 5.0 and / or the PDK ?

Thanks

Sam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sam,

sorry, I don't really understand your question.

First: Yes, it is definitely possible to connect to an external SQL server in your custom iViews. And: Yes, JDBC is the correct approach to do so. The producures for connecting are standard JDBC codings, no SAP specific things around here. You should easily find some jdbc tutorials on the web by googling for them.

Regards,

Dominik

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Sam: Just put your jdbc driver library (jar file) into the iview library folder and use it.

Info about jdbc url you'll find probably in driver doc.

Regards,

Artur

Former Member
0 Kudos

Thanks Dominik & Artur,

What I wanna ask is there any jdbc driver contained in the EP / PDK already? Or I need to download a third party driver for use?

Thanks

Sam

Former Member
0 Kudos

Hi Artur,

Thanks for your instruction, but do I need to copy the jar file to each iView? Can I place the jar file in a central place and let every iView make use of it?

Thanks

Sam

Former Member
0 Kudos

You need to write a portal service that exposes the JDBC library to your custom iView. I have seen few weblogs/articles on SDN about that.

Former Member
0 Kudos

Hi ArulRaja,

Do you mind to post the link or the location of those articles?

Thanks

Sam

Former Member
0 Kudos

Dear Artur,

This is my code that try to make the connection:

////////////////////////////

Class.forName("classname");

<b>Connection</b> con = <b>DriverManager</b>.getConnection("jdbc:sap:sqlserver://msnt189:1433;DatabaseName=net_dev;SelectMethod=cursor", "sa", "pwd");

<b>Statement</b> std = con.createStatement();

<b>ResultSet</b> res = std.executeQuery("select * from usr_uom_master");

con.close();

///////////////////////////

When I typed the above code in eclipse, it can't recognize those bolded type. Which library do I need to import for this?

Besides, I still can't find the needed JDBC class to use.

Thank you very much

Sam

Message was edited by: Sam Choy

Message was edited by: Sam Choy

Former Member
0 Kudos

Hi Artur,

Do you mind to quote some code example on making the connection with the JDBC?

Thanks

Sam

Former Member
0 Kudos

Dear all,

Problem Solved!

Thanks very much

Sam