cancel
Showing results for 
Search instead for 
Did you mean: 

creating new dbpool and a new driver

Former Member
0 Kudos

hello again.

I am trying to create a new driver (with the sap engine administrator) and a new dbpool.

I am talking about a driver for the oracle db. The driver files are contained in the classes12.jar. I have put the jar in several locations in the portal but I still get an error: driver class not found: oracle.jdbc.OracleDriver.

Can you tell me how this is done, and where should the jar be put so that the oracle driver is found?

Thank you

Silviu Lipovan Oanca.

Accepted Solutions (0)

Answers (2)

Answers (2)

guru_subramanianb
Active Contributor
0 Kudos

Hi,

I thought you are using netweaver developer studio for developing your java program.

Since you have said that ur using eclipse then it is simple in operation.Right click your project and then add your file or simply put this jar file in the "lib" folder inside your project structure.This will set your classpath there by u can connect to the back end.

Rdgs,

Guru

Former Member
0 Kudos

hi

well.. this is not the issue...

the jar exists in my lib folder. it is no problem compiling my project and if I would use a direct connection everything would be fine.

but I want to use the portal's dbpool service. I want to define here a new driver and a new pool, using the drivers provided by oracle... this can be done in sap j2ee engine administrator.

now I've put the jar under additional_lib/com/sap/data_direct_driver_reference, also under jdbc_driver_reference and also under several other locations, but still engine administrator seems unable to find the classes I need. I dont know where to put the jar containing the classes.

I hope it's clearer now.

Thanks in advance.

Silviu Lipovan Oanca

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Silviu,

Just to be sure, you've defined the new driver and new pool in the J2EE administrator and it correctly starts up? If you are trying to use the pool why not just reference the connection directly from your code, something like the following:


DataSource dataSource = null;
InitialContext ctx = new InitialContext();
dataSource = (DataSource) ctx.lookup("jdbc/oracleDefault");
con = dataSource.getConnection();

Where oracleDefault is your alias name that you configured in the J2EE Administrator.

Hope this helps,

Marty

Former Member
0 Kudos

Hello Marty,

No, I could not define the driver and pool in the administrator... that is the problem.

Other than that, referencing the connection from the code is exactly as you say above.

Again: the problem is creating the driver and pool in the administrator, because I do not know where to put the driver jar file in order to be found by the administrator. This is the question.

Thank you,

Silviu Lipovan Oanca.

Former Member
0 Kudos

Hi Silviu,

have a look at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/80/4f34c587f05048adee640f4c346417/frameset.htm">this</a> page in the documentation that describes how you can deploy the driver on the server. Simply copying the file on the filesystem will not work, as the J2EE Engine/portal v.6.40 keeps configuration data & binaries in the database.

Hope that helps!

Former Member
0 Kudos

Hello Ivaylo,

I am using ep6 sp2 (J2EE engine v6.20). The page you posted refers to the nw04 documentation (at least that's what I see). But anyway, I'll be browsing through the help, maybe something comes up. So thank you for the link, it's a starting point.

Basically I have followed the steps described in the docs for nw04 (though it's not exactly the same for ep6), and the driver adds succesfully. Still, when I try to create a new pool and use the driver, I get that error with "driver class not found: oracle.jdbc.OracleDriver.

Thank you,

Silviu Lipovan Oanca

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Silviu,

Maybe you can try adding the driver from the telnet console of the J2EE Administrator.

Open a command prompt:

telnet <portal server> 50008

login with Administrator / <blank password>

type 'lsc' to get a list of nodes

type 'jump 10155633' (where that number is your server number returned from the lsc command above)

type 'add dbpool'

then type 'REGISTER_DRIVER oracle.jdbc.OracleDriver c:\myfiles\classes12.jar' (no quotes needed)

Hopefully this registers the driver for you to make it visible when you create your pool.

Thanks,

Marty

Former Member
0 Kudos

Hi Silviu,

sorry, did not know that you're on 6.20.

Anyway, if you say that you add the driver successfully, the "driver class not found: oracle.jdbc.OracleDriver" error could be caused by a missing classloader reference from the Dbpool service to the driver's library. Can you check that? To to it, go to the Dbpool service in the Visual Administrator, open the Control Descriptor -> Distribute tab and see if you have the reference to the driver library. If not, add one using the Add button there. For a general reference on how to do it, use the Administration Manual (this time the 6.20 one )):

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webas620/administration manual for sap j2ee engine 6.20.pdf -> Chapter 4: Configuration Tasks -> Configuration of Additional Libraries -> Setting References from Service to Services or Libraries section.

Hope that helps!

Former Member
0 Kudos

i did both the manual registration proposed by Marty and I added the reference to the library (after reading the pages in the manual) proposed by Ivaylo. The error is still there, undisturbed

One more question: I have the oracle.jdbc.OracleDriver in 2 packages... one is classes12.zip and another is oracle14.jar. The oracle14.jar is not working with my java test class that performs a direct connection to the database. Do you think this can have anything to do with the issue? on the portal I tried to use classes12.zip.

Former Member
0 Kudos

I finally figured it out.

After n-times checking the correct jars and such, I noticed that the jar file placed under com/sap/jdbc_driver_references had a size of 0 bytes. so I looked for the jar and found it elsewhere in the portal, I copied it over the jar of size 0 from the directory mentioned above, then went to visual administrator and redefined the driver and added this jar to its file list. After that, when I created a new pool and set it to use the driver, everything worked just fine.

Anyway, I wanted to thank you all for your interest.

Laters,

Silviu Lipovan Oanca.

guru_subramanianb
Active Contributor
0 Kudos

Hi,

Just right click your project from the studio.Select properties and then click on java build path.then select add external jars option.select classes12.jar from your local machine and then import it to the portal.It will set your classpath required to connect to your backend namely oracle.

Hope it helps.

Regards,

Guru

P.S :- close this thread if it answers your query.

Former Member
0 Kudos

I am not sure I understand.

What studio?

I am using eclipse for development and have an ant build for creating the par file. The jar is added as an external jar to my project, as you described.

The part that I dont understand is how does the jar get imported into the portal...

sorry for being such a hard head, but it's not very long since I am developing on the portal, and it's the 1st time I have these issues. thanks.