wood burning stoves 2.0*
The moose likes JDBC and the fly likes JDBC Error :- End of TNS data Channel. SQL Exception Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Error :- End of TNS data Channel. SQL Exception Error" Watch "JDBC Error :- End of TNS data Channel. SQL Exception Error" New topic
Author

JDBC Error :- End of TNS data Channel. SQL Exception Error

Shantanu Gangakhedkar
Greenhorn

Joined: Jan 19, 2000
Posts: 15
Hello Friends,
I am trying to use Type 4 JDBC Drivers :- 816classes12b.zip oracle Drivers for Connectivity
with Oracle database My Program works fine with same database with ODBC Bridge Drivers and
same TNS Name. I am using 8.0.3.0.0 oracle enterprise version. Please tell me the URL of any
compatible drivers for oracle version.
My Code is :-

public Database(String pstrUserID, String pstrPasswd) {
this.mstrUserID = "scott"; //pstrUserID;
this.mstrPasswd = "tiger"; //pstrPasswd;
SID = "ORCL"; //"ORCL";
DBServer = "cilbank";
DBPort = 1521;

// mstrjdbcURL = jdbc racle:thin:@"+DBServer+":"+DBPort+":"+SID;
mstrjdbcURL="jdbc racle:thin:@cilbank:1521:ORCL";
//mstrjdbcURL = "jdbc dbc racleback";
System.out.println (mstrjdbcURL);
}
private Connection getConnection () throws SQLException {
try {
Class.forName ("oracle.jdbc.driver.OracleDriver");
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("User ID :"+mstrUserID);
System.out.println("Password :"+mstrPasswd);
con = DriverManager.getConnection(mstrjdbcURL,"scott","tiger");
return con;
}
catch (ClassNotFoundException cnfExc) {
throw new SQLException ("Path for driver classes not set properly.");
}
}
public void mOpenConnection () throws SQLException {
if (con != null && !con.isClosed())
return;
try {
con = this.getConnection ();
}
catch (SQLException sqlExc) {
sqlExc.printStackTrace();
throw new SQLException ("Fatal
Error!Error while connecting to database. "+sqlExc.getMessage () + "|----|" + sqlExc.getErrorCode());
}
if (con == null)
throw new SQLException ("Driver not found.");
con.setAutoCommit (false);
}
When i Execute my class it gives following SQLException End of TNS data channel.
I am not getting this problem.I am returing errorcode also but it gives 0 means there is no problem
EXCEPTION :-
jdbc racle:thin:@cilbank:1521:ORCLUser ID :scott
Password :tigerjava.sql.SQLException: End of TNS data channelat oracle.jdbc.dbaccess.DBError.check_error(DBError.java:406)at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:169)at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:231)at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:208)at java.sql.DriverManager.getConnection(Compiled Code)at java.sql.DriverManager.getConnection(DriverManager.java:137)at Database.getConnection(Database.java:56)at Database.mOpenConnection(Database.java:67)at Database.main(Compiled Code)Exception:Fatal Error!Error while connecting to database. End of TNS data channel|----|0Process Exit...

Please any body help me in this.
Thanx in Advance.

S.R.Gangakhedkar
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
The End of channel error is an error originating from the database/network and not your java code. You need to check with your DBA to ensure that your URL is correct. If it is, the problem could also be generated if there is more than one entry on the domain server for the domain name (or a conficting enrty in your host file).
[This message has been edited by Carl Trusiak (edited June 18, 2000).]


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Error :- End of TNS data Channel. SQL Exception Error
 
Similar Threads
oracle does not listens on TCP/IP port
JDBC realm URL Tomcat4.0
getconnection() --> SQLException
JDBC using Oracle with Servlets
Classes12.zip Thin Drivers