Hi,
I have written an simple
jsp code to connect to the database and retrive some records.
In the first stage, it is giving me below error message.
" java.sql.SQLException: Io exception: The Network Adapter could not establish the connection "
I m running it on the eclipse.
Jsp code file :
<%@ page import="java.sql.*" %>
<%
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin://10.26.71.17:1521/preclrty","cprg","c10");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from service_types");
%>
<% if(rs.next())
{
rs.previous();
%>
<table width="830" border="1" align="center" bordercolor="#000000">
<tr>
<td width="63" align="center"><span class="style25">Your Account Balance: <b>Rs.</b></span></td>
<%
while(rs.next())
{
%>
<td width="63" align="center"><span class="style25"><%=rs.getString(2)%></span></td>
</tr>
<%
}
}
else
{
%>
<%
}
}catch(Exception e)
{
out.println("the error is "+e);
}
%>
Note : I have removed the html tags from the file.
Can someone help help.
I m trying to learn basic programming using the JSPs, to build an front for my daily activities.
I think I have missed out some configurations.
Please help me thank you in advance.