Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

oracle Conenctivity using Thin Drivers  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to make a Database Connection to Personal oracle 8 using thin driver classes12.zip I am using windows98 and personal oracle. It compiles properly but when I run it i get the following SQL error :
"error My Own Sql error:IO exception:The network Adapter cannot establish the connection ".
I havent made a SID in my oracle. Is a SID important?
============================================================
oracle 8import java.sql.*;
import java.io.*;
public class Jdbc1test
{
static String DB,USER,PASS, Query;
static Connection connection;
static Statement stmt;
static ResultSet rs;
public static void main(String args[])
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
connection=DriverManager.getConnection ("jdbc racle:thin:@192.168.0.1:1521 rcl","scott","tiger");
stmt=connection.createStatement();
Query="select * from emp";
rs=stmt.executeQuery(Query);
while(rs.next()) // while loop
{
int s1=rs.getInt("empno");
String s2=rs.getString("ename");
System.out.println(s1+ " " + s2);
}
rs.close();
connection.close();
} // end of try
catch(ClassNotFoundException e)
{
System.out.println("Error My Own class not found : "+e.getMessage());
}
catch(SQLException e)
{
System.out.println("Error My Own sql error: "+e.getMessage());
}
catch(Exception e)
{
System.out.println("Error My Own other errors: "+e.getMessage());
}
}// end of main
}// end of class
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!