• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error: no interface is connected

 
sunny
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to access database from oracle using following code
Class.forName("sun.odbc.jdbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("Odbc:Jdbc racle","scott","tiger");//giving error
Statement st=con.CreateStatement();
ResultSet rs=st.executeQuery("select * from emp");
while(rs.next())
System.out.println(rs.getString(1));
there is no compilation error but when try to run it gives the sqlexception saying no interface is connected (oracle is a datasourcename for oracle odbc driver 32bit) and the same code works with ms-access
Please
thanks
sunny
 
Srinath R
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u have to go to oracle navigator and there u have to select local database and add new database link which will be a "xyz.world"
then goto database connection there u will have an configure button where u will have to add the just created database link
then later goto ur control pannel and create an dsn in which u have a collom for services type the datalink name.
doing so u will be ablw to get the data from the result set
but whis has crashed my jvm if u can find the remady to this problem then aneswer my query titeled "jdbc oracle problem"
 
siva kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi try to use orcledriver instead of jdbcodbcdriver.
this driver will not work for oracle database.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic