Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Caught: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

 
Malathy Emm
Greenhorn
Posts: 2
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am new to both java and groovy,
I have to connect to oracle through using JDBC connectivity in groovy

package com.MyWorks
import groovy.sql.Sql
sql = Sql.newInstance("jdbcracle:thin:@localhost:1521", "username",
"password","oracle.jdbc.driver.OracleDriver")
sql.eachRow("SELECT file_id, record_id FROM Employee ")
{
println "The details are ${it.file_id} ${it.record_id}."
}

Is my code correct. I got Caught: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection error. Can anyone help me on this
 
Malathy Emm
Greenhorn
Posts: 2
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also i forgot to add that i have supplied my application's username and password.
 
Swastik Dey
Rancher
Posts: 1639
6
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure oracle service and tns listeners are running.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic