• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connecting iseries to Oracle using Java program

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been testing a Java program to connect from my iSeries to an Oracle database.
If I hard code the connection string, everything works fine.
If I pass the details of the connection string as parameters and then build the connection string inside the Java program, I receive a driver error.
The hard coded connection string (which works) is..
 

 



When I pass the IP address, sysname, userId & password in, I receive a driver error.
 The Java program is this.....



I simply want the connection to work (ie get the Done message!)
This is the error I receive...

                           

 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dave, welcome to the Ranch!

Looks like there are several things you did differently when you tried to build your own connection parameters. In your hard-coded version you used a getConnection() method which had three parameters -- the URL, the user ID, and the password. But in your other version you used a getConnection() method with only one parameter. I think you tried to jam all three parameters into that one string, including some extra quotes to make it look like the original code.

So the URL you need is built from IPad and PortNo and OServer only. Don't put extra quotes around that. Then the code you need is like this:





 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic