Home » Developer & Programmer » JDeveloper, Java & XML » need Help in JDBC ODBC
need Help in JDBC ODBC [message #92093] Mon, 08 March 2004 07:45 Go to next message
abdul
Messages: 18
Registered: May 2001
Junior Member
i have install the ODBC driver for ORacle from orale Site but after Runing this code

///////////////
<%@ page language="java" import="java.sql.*" %>
<%
String userId = request.getParameter("userId");
String password = request.getParameter("password");
String dbpassword = null;
Connection con=null;
Statement stat=null;
ResultSet rs=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection ("jdbc:odbc:naveed2", "digital", "matl#1"); stat=con.createStatement();
rs=stat.executeQuery("select * from loginfo Where loginfo_id="+ userId +"' ");
if (!rs.next())
out.println("User ID is wrong...");
rs.next();
dbpassword=rs.getString("password");
con.close();
}
catch(Exception e)
{
//response.sendRedirect("login.jsp?error=1");
out.println(e.toString() );
return;
}

if (!dbpassword.equals(password))
{
//response.sendRedirect("login.jsp?error=1");
out.println("Password is wrong");
}
else
{
session=request.getSession(true);

try
{
if(session!=null)
{
session.putValue("userId", userId);
}
}
catch(Exception e)
{
out.println(e.toString() );
}

//out.println("Succss in login");
response.sendRedirect("user_Login.jsp");
}
%>

it gives me the following error

java.sql.SQLException: [[Oracle]][[ODBC]][[Ora]]ORA-01756: quoted string not properly terminated

any one here to Help
Re: need Help in JDBC ODBC [message #92116 is a reply to message #92093] Mon, 15 March 2004 17:47 Go to previous message
Raghavendra
Messages: 69
Registered: December 2000
Member
i would like to know how to write the programing statements in java to connect to oracle and also i would like to know what drivers are requiree and how the path should be set
Please reply
Previous Topic: ProductOrder.jar
Next Topic: Tcp Packet monitor Problem
Goto Forum:
  


Current Time: Sat Jul 24 15:55:12 CDT 2021