hello ranchers..
I can run the query if i give the query using the to_char
but in my program it is not working
the query is this
select to_char(datein,'dd-mmm-yyyy') from ff order by datein;
it is working in sql prompt..
but it is not working in jsp page..
_________________________________________________________________________
my code is here
______________________________________________________________________
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>DETAILS</title>
</head>
<%@ page language="java" session="true" import="java.sql.*" import= "java.lang.*" %>
<body>
<table border =1 width = "100%">
<tr>
<td> Date in</td>
<td> Name </td>
</tr>
<%
try
{
try
{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e)
{out.println(e);
}
String dbURL = "jdbc
dbc:test";
Connection dbCon;
dbCon = DriverManager.getConnection(dbURL,"aravindprasad","2356296");
StringBuffer tab1 = new StringBuffer();
tab1.append("select to_char(datein,'dd-mm-yy') from ff");
String query = tab1.toString();
out.println(query);
Statement stmt = dbCon.createStatement();
ResultSet rs = stmt.executeQuery(query);
// declaring the variables
while(rs.next())
{
//Date datein = rs.getDate(1);
//String name = rs.getString(2);
Date datein = rs.getDate(1);
%>
<tr>
<td><a href ="check.jsp?datein=<%=datein%>">
<%=datein%> </a> </td>
</tr>
<%
}
rs.close();
dbCon.close();
stmt.close();
%>
</table>
<%
//stmt.close();
}
catch(SQLException e)
{//response.sendRedirect("error.html");
out.println(e);
}
%>
</body>
</html>
___________________________________________________________________
i think the code has to work properly
but it is showing the error like this
java.sql.SQLException: [Oracle][ODBC]Datetime field overflow.
____________________________________________________________________
can u pls help me.. to solve this problem..
thanks in advance