my problem concerning JdbcOdbcDriver was not solved.a friend(Randy it was u!) 
suggested that this driver is not thread safe/has problems with multithreading.(that's 
hebrew to me,coz i am a first time server programmer)

incidentally i got the following server window msgs when using jdbcodbcdriver.can any 
1 tell me what it means!!(my index page has 3 frames having first.html,second.html & 
third.html.the login textboxes are in third.html which lead to login.jsp on submit.my 
app is named project)
[ 
2001-07-06 12:50:26 - Ctx( /project ): IOException in: R( /project + /jsp/first.
html + null) Connection reset by peer: socket write error
2001-07-06 12:50:26 - Ctx( /project ): 404 R( /project + /jsp/login.js + null) n
ull
2001-07-06 12:50:26 - Ctx( /project ): IOException in: R( /project + /jsp/third.
html + null) Connection reset by peer: socket write error
]

however i also tried with a type 4 driver:i-net Seropto(tm) optional package 
driver(ver1.0 for Oracle 8.0 server).classname--com.inet.ora.OraDriver.it is said to 
support the following:
Oracle Server, Java and JDBC Versions
--------------------------------------
        Java Versions: 1.2.x or higher
        JDBC Version:  2.0

        Oracle Server Version: 8.0.4.0
i have Oracle8.0.4 personal edition,jdk1.2.2.i have included the jar files for both 
the driver and jdbc2.0 optional package in c:\tomcat\lib\.
i modified th login.jsp used for jdbc-odbc driver as follows:
[
<%@ page session="true" import="java.sql.*,java.io.*" %>


<% 
String s1=request.getParameter("user");//username
String s2=request.getParameter("pwd");//password
String upwd=null;
FileOutputStream fos=null;
PrintStream prs=null;

try{
        fos=new FileOutputStream("error.txt");
        prs=new PrintStream(fos);
        //DriverManager.setLogStream( System.out );
if(s1.length()==8 &&  s2.length()==6)
{
        out.println("loading driver");
                 Class.forName("com.inet.ora.OraDriver").newInstance();
                out.println(" driver loaded");
                DriverManager.registerDriver(new com.inet.ora.OraDriver());
                        out.println("driver registered");
                Connection 
con=DriverManager.getConnection("jdbc:inetora","scott","tiger");
                                out.println("got connection");
                Statement ps=con.createStatement();
               // ps.setString(1,s1);
                ResultSet rs=ps.executeQuery("SELECT password FROM login WHERE 
username'"+s1+"'");
                if(rs!=null)
                {
                        while(rs.next())
                                        {
                                upwd=rs.getString("password");
                        }
                }

                con.close(); 
                if(upwd!=null)
                {
                
                        if(s2.equals(upwd))
                        {       
                                                out.println("Welcome Back to this site 
"+s1);
                        }
                         
                        
                                        else
                        {
             
                                                out.println("Incorrect password");
                        }
             
                        }
                                else
                        {     
                                        out.println("Incorrect username ");
                }
                
                
                
                


}
else
{

        out.println("Invalid no. of characters in username/password");
}
}
catch(Exception ex){
ex.printStackTrace(prs);
out.println(ex.getMessage());
out.println(ex);}

 %>





]

i got the following output in the browser:
loading driver driver loaded driver registered Connection refused: no further 
information com.inet.ora.SQLException: Connection refused: no further information 
what the hell??

please offer a solution.
thanx.



ddr

____________________________________________________
Buy Feng Shui Package for Rs. 151/- only, at 
http://shopping.rediff.com/shopping/fengshui_mailer.htm



Reply via email to