Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Installation problem

  Asked By: Cameron    Date: Nov 06    Category: Java    Views: 571
  

I have Personal Oracle8 as well as JDK 1.3 installed
in my computer with Windows 98. I want to run some
JDBC programs in my machine but unable to do so.

The problem lies with the code where the connection is
being made with Oracle database. I am unable to find
out the correct combination of driver and protocol
needed.

I tried with several options but nothing is working.
My program is getting compiled but while running, it
is showing the below mentioned error.

I have the required .ZIP and .OCI files in required
folders and the CLASSPATH and PATH are set according
to that as followes.

-----------------------------------------

C:\OraWin95\bin\CLASSES102.ZIP
C:\OraWin95\bin\CLASSES111.ZIP

C:\OraWin95\bin\OCI733JDBC.DLL
C:\OraWin95\bin\OCI803JDBC.DLL

-----------------------------------------

C:\OraWin95\jdbc\lib\CLASSES102.ZIP
C:\OraWin95\jdbc\lib\CLASSES111.ZIP

C:\OraWin95\jdbc\lib\OCI733JDBC.DLL
C:\OraWin95\jdbc\lib\OCI803JDBC.DLL

-----------------------------------------

SET PATH = D:\orawin95\bin;D:\orawin95\jdbc\lib;
SET CLASSPATH =
D:\orawin95\;D:\orawin95\bin;D:\orawin95\jdbc\lib;

-----------------------------------------

And the error messages are:-

With oci7 and oci8 drivers---
java.exe JdbcCheckup
java.lang.UnsatisfiedLinkError: make_c_state at
oracle.jdbc.oci7.OCIDBAccess.make_c_state(Native
Method) at
oracle.jdbc.oci7.OCIDBAccess.logon(OCIDBAccess.java:142)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:93)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:146)
at java.sql.DriverManager.getConnection(Unknown
Source) at
java.sql.DriverManager.getConnection(Unknown Source)
at JdbcCheckup.main(JdbcCheckup.java:10)Exception in
thread "main" Application Exit...


With thin driver---
java.exe JdbcCheckup
java.sql.SQLException: oracle at
oracle.jdbc.dbaccess.DBError.check_error(DBError.java:203)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:100)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:146)
at java.sql.DriverManager.getConnection(Unknown
Source) at
java.sql.DriverManager.getConnection(Unknown Source)
at JdbcCheckup.main(JdbcCheckup.java:12)Exception in
thread "main" Application Exit...


-----------------------------------------

import java.sql.*;
import java.io.*;

public class JdbcCheckup
{
public static void main(String[] args) throws
SQLException, IOException
{
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());

//Connection conn =
DriverManager.getConnection("jdbc:oracle:oci7:@",
"scott", "tiger");

//Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@oracle:1521:orcl",
"scott", "tiger");

Connection conn =
DriverManager.getConnection("jdbc:oracle:oci8:@",
"scott", "tiger");

Statement stmt = conn.createStatement();

ResultSet rset = stmt.executeQuery("Select 'Hello
World' from dual");

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

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

rset.close();
stmt.close();;
conn.close();
}
}

Kindly help me to solve this. Your help would be
highly appreciated.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Installation problem Or get search suggestion and latest updates.




Tagged: