Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with JDBC - JAVAI.DLL & place to get Pro-C compiler 1

Status
Not open for further replies.

ifxtechie

Technical User
Dec 22, 2000
127
US
Hi,
I need some help in executing my Java programs which use JDBC.
I have installed Oracle-8i on Windwos-me. Everything works fine. But I have problems with JDBC connection. I am trying to connect to the Oracle server using JDBC. The Program JdbcCheckup.java supplied by Oracle corporation errors out hen executed. But when I execute that it gives me the error as
"Java has caused an error in JAVAI.DLL.
JAVA will now close.

If you continue to experience problems,
try restarting your computer."

This is the same problem with all the JDBC related programs.

I am using Java 1.2.2 version
I have set the classpath to point to Oracle jdbc driver classes [classes111.zip] and also set the path to point to {ORACLE_HOME}/lib.
Can anybody please suggest me what I miss or where I am wrong to get-rid of this error.
Also, can anybody please suggest me where I can download Pro-C compiler
Thanks in advance
Parthasarathy Parthasarathy, Hassan
 
There is a classes12.zip file available on the Oracle website.
 
Thanks Raygg, I have downloaded that and tried with that also. But the error is same and could not execute the program. any other suggestion is highly appreciated
thanks
Partha Parthasarathy, Hassan
 
Now I am getting a different error :
C:\dbprgs>java JdbcCheckup
Please enter information to test connection to the database
user: scott
password: tiger
database (a TNSNAME entry): pardb
Connecting to the database...Connecting...
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.l
ibrary.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1249)
at java.lang.Runtime.loadLibrary0(Runtime.java:470)
at java.lang.System.loadLibrary(System.java:778)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:228)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)

at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va, Compiled Code)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at JdbcCheckup.main(JdbcCheckup.java, Compiled Code)


Anbody, Pls see this and can you suggest me how I can proceed
Thansk in advance
Partha Parthasarathy, Hassan
 
You may be having problems because you are on windows Me - Oracle corp never certified oracle for win-me - you may be able to run some of the oracle features and add-ons but sooner or later you will run into trouble - like with this java thing. If have a copy of win98 you can load personal oracle 8i and everything should run ok. If you need a network version of oracle to run then get win2k or win-nt.
 
Thanks for the suggestion.
Now I am trying with windows-2000 server. Here it is a different scene. Here I am neither getting the error for the successful connection nor getting connected [nor a success message]!

For the code segment :

System.out.println (&quot;Trying ..connecting...&quot;);
try
{
System.out.println (&quot;Now in the Try ......&quot;);
conn =
DriverManager.getConnection (&quot;jdbc:eek:racle:eek:ci8:mad:&quot; + database, user, password);
}
catch (Exception k)
{
System.out.println (&quot;Error in Getting connection...&quot;);
}

System.out.println (&quot;connected.&quot;);

// Create a statement
Statement stmt = conn.createStatement ();

// Do the SQL &quot;Hello World&quot; thing
ResultSet rset = stmt.executeQuery (&quot;select 'Hello World' from dual&quot;);

while (rset.next ())
System.out.println (rset.getString (1));

System.out.println (&quot;Your JDBC installation is correct.&quot;);


It is not coming to the &quot;connected&quot;

the ouptut is as below :

C:\dbprgs>javac JdbcCheckup.java

C:\dbprgs>java JdbcCheckup
Please enter information to test connection to the database
user: scott
password: tiger
database (a TNSNAME entry): pardb
Connecting to the database...Connecting...
Trying ..connecting...
Now in the Try ......

C:\dbprgs>

Can you pls tell me why this is happening and it is not getting connected. Your help is highly appreciated
Thanks in advance
Partha
Parthasarathy, Hassan
 
I do not know much about setting up a jdbc connection - I am just getting involved with that myself - but first I would make sure that I can connect to the oracle db on the win2k server from another oracle client to the server to make sure that the listener etc is working. At least that way you can make sure it is a java problem and nothing else is at fault.
 
Hi
Thanks for your valuable suggestion. Can you pls elaborate on connecting from Client machines [I am able to connect through ODBC]. Do you recommend to reinstall jdbc
Your suggestion is highly appreciated
Partha Parthasarathy, Hassan
 
Hai use this set of statement format inside try block!

Class.forName(&quot;oracle.jdbc.driver.OracleDriver&quot;);
con1 = DriverManager.getConnection(&quot;jdbc:eek:racle:thin:mad:service name or ip address:1521:hoststring&quot;, &quot;username&quot;, &quot;password&quot;);

and also check thetnsnames.ora file
to define the tns nmae!
hope u will succeded this time!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top