Solved

Invalid Oracle URL specified connecting to 8.1.7

Posted on 2003-11-26
11
1,151 Views
Last Modified: 2012-06-22
I get an Invalid Oracle URL specified error connecting to an Oracle 8.1.7 database. I am Java 1.4.2 and the Oracle Database driver is 'j2sdk1.4.2'. I got on Oracle OTN to attempt to get another driver and the latest I find is for Java 1.2(class12.zip). Does this mean there is no driver available for Oracle 8.1.7 and Java 1.4.2? Bellow is by Oracle error.
----------------------------------------------------------

Connect String:jdbc:oracle:thin@1xx.xx.xxx.xxx:port:sid
Error Connecting to Database:xxxx
Connect String:jdbc:oracle:thin@999.99.999.999:5555:2222
SqlException:Invalid Oracle URL specified
SqlState    :null
Vendor Error:17067
------------------------------------------------
java.sql.SQLException: Invalid Oracle URL specified
0
Comment
Question by:rayskelton
  • 5
  • 4
11 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9826563
You must use a valid IP and port number
0
 

Author Comment

by:rayskelton
ID: 9826598
I have a valid Id and Port. I blanked them out to prevent from public view.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9826827
I don't think you need to blank the port ;-) Please post again with it looking at bit more realistic
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9826908
You should be able to use the machine name too. Let's say the Oracle server machine is called 'ray' and you can do

ping ray

Then you should be able to use

jdbc:oracle:thin@ray:nnnn

where 'nnnn' is the right port number
0
 

Author Comment

by:rayskelton
ID: 9826997
Below is the exception thrown. I have 2 drivers I have tried this with.-- classes12_g.zip and ojdbc14.jar --
My classpath is:/i2k/rxs/java/j2sdk1.4.2/lib:/i2k/rxs/java/j2sdk1.4.2/drivers/classes12_g.zip:.
------------------------------------------------------------

Connect String:jdbc:oracle:thin@172.25.248.215:1531:i2d2
Error Connecting to Database:i2d2
Connect String:jdbc:oracle:thin@172.25.248.215:1531:i2d2
SqlException:Invalid Oracle URL specified
SqlState    :null
Vendor Error:17067
------------------------------------------------
java.sql.SQLException: Invalid Oracle URL specified
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 86

Expert Comment

by:CEHJ
ID: 9827433
Please post your connect code
0
 

Author Comment

by:rayskelton
ID: 9827516
public int getDbConnect()
{
   // set class members with configuration
   // information read from the properties file
   host = System.getProperty("host");
   userName = System.getProperty("user");
   url = System.getProperty("url");
   passWord = System.getProperty("password");
   port = System.getProperty("port");
   sid = System.getProperty("sid");
   databaseName = System.getProperty("databaseName");
   maxSelectRows = System.getProperty("maxSelectRows");

   // Determine which system we are on
   // the MySql driver is for Linux *
   // Oracle this is for Oracle Driver
   String connectString = null;  
   if(url.compareTo("jdbc:mysql//") == 0)
     {// MySql Database
     connectString = url + host + ":"
                                + port + "/" + sid
                                + "?user=" + userName
                                + "&password=" + passWord;
     }
   else
     if(url.compareTo("jdbc:oracle:thin@") == 0)
       {// Oracle Database
       connectString =  url + host + ":" + port + ":" + sid ;
       }
   else
     System.out.println("Unsupported URL for this application:" + url);                                

   try
     {
     System.out.println("Connecting to Database:" + databaseName
                         + sid + " at port:"+ port);
     System.out.println("Connect String:" + connectString);

     connection = DriverManager.getConnection(connectString);
     System.out.println("Connection established for:" + databaseName);
     connection.setAutoCommit(false);
     }

   catch(SQLException ex)
     {
      System.out.println("Error Connecting to Database:" + sid);
      System.out.println("Connect String:" + connectString);

      System.out.println("SqlException:" + ex.getMessage());
      System.out.println("SqlState    :" + ex.getSQLState());
      System.out.println("Vendor Error:" + ex.getErrorCode());
     
      System.out.println("------------------------------------------------");
      sqlEx.printStackTrace();

     }
     
return(0);
}
0
 

Author Comment

by:rayskelton
ID: 9828142
I resolved this issue by adding a ':' between the thin and @.  
jdbc:oracle:thin:@")

Thanks for youe help
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9828150
OK :-)
0
 
LVL 2

Accepted Solution

by:
Lunchy earned 0 total points
ID: 10197170
PAQed, with points refunded (250)

Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
network + 7 73
count11 challenge 6 49
Problem to start Neon 20 54
JUnit 4 @Before and @BeforeClass differences 3 24
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now