Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

this is jdbc error not oracle error

 
muhammad fahim
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir i post my problem but they reply me it java problem not oracle problem

*** oracle reply**********
You metioned that you use
jdbcracle:thin:@<ip or hostname of machine where your db is installed>: 1521:aamir , description to connect the remote database. So, I think it's not related to your tnsname.ora problem. It's only java oracle thin connection string. Please check this string, make sure the ip and database service name is right.

one more thing, use sqlplus check your tnsname.ora, if ok, then try to check jdbc and make sure the jdbc driver match to oracle server.

*********************

sir please give me idea how i show my oracle data in clinet browser

thank's

aamir
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We don't have any visibility of the actual problem, only the response you got when you asked it somewhere else. Can you explain your problem?
 
muhammad fahim
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir this is my jsp code this page give me right result in my browser
when am using work group not internet or local network

<HTML>
<%@ page import="java.sql.*,java.util.*" %>
<% String url="jdbcracle:thin:@10.0.0.237:1521:aamir";
Connection con;
Statement stmt;
ResultSet rs;
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con = DriverManager.getConnection(url,"muhammad","mfa786");
stmt=con.createStatement();
%>
<%

%>
<select name="ltpid">
<%
try{
rs= stmt.executeQuery("select accid,title from chartofacc");
while (rs.next()){
%>
<option Value=<%=rs.getString(1)%>> <%=rs.getString(2) %> </option>
<%
}
}
catch(Exception e){}
%>
</select>
<br>
TEST DONE!
</HTML>


***********
but when i test this page in client browser then browser give me this error


Database Log In Failed
TNS could not resolve service name

Verify that the TNS name in the connectstring entry of the DAD for this URL is valid.


i check my tnsname.ora
my sql run fine

please give me idea how i run my page in client browser

thank's

aamir
 
Scott Selikoff
author
Saloon Keeper
Posts: 4010
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an Oracle issue. TNS is a Oracle-specific protocol and configuring the listener has nothing to do with JDBC.

Please do not duplicate post.
 
Duke Astron
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you say that it works from your PC but not from a client's PC, are you sure your accessing that JSP page from the same application server?

maybe you have a development environment where you have your own app server and since you already have everything setup up properly there, you don't encounter problems. try to access that JSP page from your own PC and make sure that you're referencing the same application server that the client is using.
 
Jeevan Philip
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
url="jdbcracle:thin:@10.0.0.237:1521:aamir";


Are you able to access this ip address from client network? Is there a firewall in between which might be blockng the IP or port or both?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic