You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by RAHUL RAJ <om...@gmail.com> on 2011/04/15 12:04:37 UTC

Working of Tomcat with MS Access

Hello,
     I am working on  building a jsp website with MS Access as
database. When my login page is loaded on tomcat
(localhost:8080/login.jsp), it shows the following error:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
name not found and no default driver specified.

The jdbc program alone is working perfectly, So There might not be
problems due to  Driver, Data source name, Database Tables or any
other software version compatibilities.

OS: Windows Vista Home Basic
Tomcat Version: 5.5.x
jdk version: 1.6
MS Access 2010


code is given below:

<%@ page language="java" import="java.sql.*" %>
 <html>
 <body>
 <form method="post">
 <p> Enter your username :  <input type="text" name="username"/> </p>
 <p> Enter your password :  <input type="text" name="password"/> </p>
 <input type="submit" value="Login"/>
 <%
    String usn = request.getParameter("username");
	String pass = request.getParameter("password");

	try{
	         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		 String url = "jdbc:odbc:rahul";
		 Connection con = DriverManager.getConnection(url, "", "");
		 Statement s = con.createStatement();
		
		 ResultSet rs = s.executeQuery("select * from customers");
		 while(rs.next())
		 {
		   String u = rs.getString(1);
		   String p = rs.getString(2);
		   if(usn.equals(u) && pass.equals(p))
		   {
		      out.println("login successfull");
			  }
		   else
           {
              out.println("login failed");
             }
           }
        }
		
		catch(Exception e)
		{
		   out.println("Error"+e);
		   }
 			
 %>
 </form>
 </body>
 </html>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Working of Tomcat with MS Access

Posted by George Sexton <ge...@mhsoftware.com>.
> -----Original Message-----
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Sent: Friday, April 15, 2011 1:02 PM
> To: Tomcat Users List
> Subject: Re: Working of Tomcat with MS Access
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jeff,
> 
> On 4/15/2011 11:11 AM, Jeff Hubbs wrote:
> > You do realize, I hope, that what you're proposing is akin to
> sourcing
> > parts for your jet engine from Fisher-Price?
> 
> :)
> 
> > MS Access is a desktop application that accesses files on disk.  Java
> > apps running on Tomcat typically access an RDBMS over a network
> > connection via SQL statements and their responses.  AFAIK there is
> not a
> > "server instantiation" of MS Access;
> 
> While you're right, I believe that MS has an Access JDBC (or ODBC)
> driver that allows you to specify the file to open as part of the JDBC
> URL. It's kind of like using a CSV file as a database, though...

More to the point, there's no such thing as a 64-bit ODBC driver for Access. In short, if you use Access for a data store, your app must run in 32 bit mode using a 32-bit JVM.


> 
> Anyway, this is possible. He's just missing some configuration of some
> kind. I feel kind of fortunate that I have no past experience on which
> to draw to help the OP.
> 
> Google for "read access database in Java" perhaps?
> 
> - -chris


George Sexton
MH Software, Inc.
303 438-9585
www.mhsoftware.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeff,

On 4/15/2011 11:11 AM, Jeff Hubbs wrote:
> You do realize, I hope, that what you're proposing is akin to sourcing
> parts for your jet engine from Fisher-Price?

:)

> MS Access is a desktop application that accesses files on disk.  Java
> apps running on Tomcat typically access an RDBMS over a network
> connection via SQL statements and their responses.  AFAIK there is not a
> "server instantiation" of MS Access;

While you're right, I believe that MS has an Access JDBC (or ODBC)
driver that allows you to specify the file to open as part of the JDBC
URL. It's kind of like using a CSV file as a database, though...

Anyway, this is possible. He's just missing some configuration of some
kind. I feel kind of fortunate that I have no past experience on which
to draw to help the OP.

Google for "read access database in Java" perhaps?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2olikACgkQ9CaO5/Lv0PB7IACglUXVRbvRHHNlcj6G98Ad2rjh
kRgAn1s7RvlCRbcQiugCigDG9KqXGJF+
=lSz2
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
I think I have to have tomcat (.zip) rather than md5 package..just a
moment...i will get back to you...

On Sat, Apr 16, 2011 at 8:50 AM, Leo Donahue - PLANDEVX <
LeoDonahue@mail.maricopa.gov> wrote:

>
> ________________________________________
> From: RAHUL RAJ [omrahulrajcse@gmail.com]
> Subject: Re: Working of Tomcat with MS Access
>
> >vista home basic.
> >No, I can restart tomcat each time, by clicking the start/stop button.
>
> Did you try any of the suggestions André or I offered?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Working of Tomcat with MS Access

Posted by Leo Donahue - PLANDEVX <Le...@mail.maricopa.gov>.
________________________________________
From: RAHUL RAJ [omrahulrajcse@gmail.com]
Subject: Re: Working of Tomcat with MS Access

>vista home basic.
>No, I can restart tomcat each time, by clicking the start/stop button.

Did you try any of the suggestions André or I offered?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
vista home basic.
No, I can restart tomcat each time, by clicking the start/stop button.

On Sat, Apr 16, 2011 at 2:49 AM, Leo Donahue - PLANDEVX <
LeoDonahue@mail.maricopa.gov> wrote:

> >-----Original Message-----
> >From: RAHUL RAJ [mailto:omrahulrajcse@gmail.com]
> >Subject: Re: Working of Tomcat with MS Access
> >
> >you said:
> >
> >"You need to change that account to one that has access to your mdb.
> >You
> >can do that through the Services console.  Or try starting Tomcat via
> >the
> >startup.bat file, that should launch Tomcat with the same account you've
> >logged into your system with, which hopefully is the same account you
> >need
> >to for "Access".
> >"
> >
> >I don't know how to do these...Can you explain for me?
>
> On Vista Home Basic... ?  Uh...
>
> Start/Control Panel
> Switch to Classic View
> Find Administrative Tools/Services
>
> You're on your own after this, but in a nutshell.. you need to check the
> properties of the "Tomcat Service" and see if you can change the way the
> service "Logs On"
>
> What happens when you reboot your computer? Do you have to restart Tomcat
> each time or is it still running after you reboot?
>
>
> >Also startup.bat is not there in the specified directory.
> Fine.  By the way, I never specified a directory because no one here knows
> how you've installed Tomcat 5.5.x
> I'm very fond of version x myself.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Tomcat on a Linux virtual machine

Posted by Martin Gainty <mg...@hotmail.com>.
i was reading leos post about restarting tomcat with the same username that had read access to the referenced database 
the same idea will work for tomcat if you create your VM with same login as PGUSER
password is stored in  .pgpass file if memory serves

hth
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: darryl.lewis@unsw.edu.au
> To: users@tomcat.apache.org
> Date: Sat, 16 Apr 2011 13:18:49 +1000
> Subject: Tomcat on a Linux virtual machine
> 
> I have an application (commercial) running on a virtual instance of Linux talking to a Postgres database.
> We are continually getting locks on the DB that are crashing the app.
> I think it's just bad programming on the suppliers side, but the supplier has latched onto the idea that it is because it is running on a virtual machine.
> Has any experienced any problems running Tomcat on a virtual machine similar to this?
 		 	   		  

RE: Tomcat on a Linux virtual machine

Posted by Joseph Morgan <jo...@ignitesales.com>.
We're Apache->Tomcat->MySQL all in separate Cent-OS VM's with no
problems.  It wouldn't be Tomcat anyway, right?  One might say that
something is up with the drivers used by the connection pool, but,
that's still not Tomcat, and to be accurate, the driver used by Tomcat
or an app inside Tomcat doesn't know squat about the DB being inside or
outside of a VM.

So, I'd focus entirely on the DB config and its environment.

Do you have a spare machine where you can setup a Tomcat/Postgres pair
outside of a VM?

-----Original Message-----
From: Darryl Lewis [mailto:darryl.lewis@unsw.edu.au] 
Sent: Friday, April 15, 2011 10:19 PM
To: Tomcat Users List
Subject: Tomcat on a Linux virtual machine

I have an application (commercial) running on a virtual instance of
Linux talking to a Postgres database.
We are continually getting locks on the DB that are crashing the app.
I think it's just bad programming on the suppliers side, but the
supplier has latched onto the idea that it is because it is running on a
virtual machine.
Has any experienced any problems running Tomcat on a virtual machine
similar to this?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat on a Linux virtual machine

Posted by Pid <pi...@pidster.com>.
On 4/16/11 4:18 AM, Darryl Lewis wrote:
> I have an application (commercial) running on a virtual instance of Linux talking to a Postgres database.
> We are continually getting locks on the DB that are crashing the app.
> I think it's just bad programming on the suppliers side, but the supplier has latched onto the idea that it is because it is running on a virtual machine.
> Has any experienced any problems running Tomcat on a virtual machine similar to this?
> 

Please don't hijack threads.  Start an entirely new email, rather than
editing the subject and body of a reply to existing email thread.


p


Tomcat on a Linux virtual machine

Posted by Darryl Lewis <da...@unsw.edu.au>.
I have an application (commercial) running on a virtual instance of Linux talking to a Postgres database.
We are continually getting locks on the DB that are crashing the app.
I think it's just bad programming on the suppliers side, but the supplier has latched onto the idea that it is because it is running on a virtual machine.
Has any experienced any problems running Tomcat on a virtual machine similar to this?

Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
I am working on windows platform.  I downloaded tomcat setup,  md5(.exe) and
installed it.

On Sat, Apr 16, 2011 at 3:18 AM, André Warnier <aw...@ice-sa.com> wrote:

>
>>  Also startup.bat is not there in the specified directory.
>>>
>>
> It is not there because you have downloaded and installed the "Tomcat
> installer" version, and that one does not have a startup.bat file.
>
>
> Stop your existing Tomcat service.
>
> Go back to the Tomcat website, and download the appropriate "zip" version
> (32-bit or 64-bit, depending on what your Java version is.
> (you can see that by typing "java -version" in a command window)
>
> Create a new directory on your PC (maybe call it "tomcat-zip") and unzip
> the zip-file there.
>
> Then go to the /bin sub-directory, and type "startup.bat".
> This will run this new Tomcat in the command window, under your own login
> user-id.
> Verify that it runs, with a browser, by accessing "http://localhost:8080".
>
> Type CTRL-C in the tomcat command window to stop it.
>
> Then start modifying the configuration of this new Tomcat, to add what is
> necessary to run you application.  Do it one little bit at a time, and try
> restarting Tomcat each time you modify something, so that if there is a
> problem you know what you did wrong.
>
> When that all runs, then we'll tell you how to setup this new Tomcat as a
> Windows Service.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Working of Tomcat with MS Access

Posted by André Warnier <aw...@ice-sa.com>.
> 
>> Also startup.bat is not there in the specified directory.

It is not there because you have downloaded and installed the "Tomcat installer" version, 
and that one does not have a startup.bat file.


Stop your existing Tomcat service.

Go back to the Tomcat website, and download the appropriate "zip" version (32-bit or 
64-bit, depending on what your Java version is.
(you can see that by typing "java -version" in a command window)

Create a new directory on your PC (maybe call it "tomcat-zip") and unzip the zip-file there.

Then go to the /bin sub-directory, and type "startup.bat".
This will run this new Tomcat in the command window, under your own login user-id.
Verify that it runs, with a browser, by accessing "http://localhost:8080".

Type CTRL-C in the tomcat command window to stop it.

Then start modifying the configuration of this new Tomcat, to add what is necessary to run 
you application.  Do it one little bit at a time, and try restarting Tomcat each time you 
modify something, so that if there is a problem you know what you did wrong.

When that all runs, then we'll tell you how to setup this new Tomcat as a Windows Service.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Working of Tomcat with MS Access

Posted by Leo Donahue - PLANDEVX <Le...@mail.maricopa.gov>.
>-----Original Message-----
>From: RAHUL RAJ [mailto:omrahulrajcse@gmail.com]
>Subject: Re: Working of Tomcat with MS Access
>
>you said:
>
>"You need to change that account to one that has access to your mdb.
>You
>can do that through the Services console.  Or try starting Tomcat via
>the
>startup.bat file, that should launch Tomcat with the same account you've
>logged into your system with, which hopefully is the same account you
>need
>to for "Access".
>"
>
>I don't know how to do these...Can you explain for me? 

On Vista Home Basic... ?  Uh...

Start/Control Panel
Switch to Classic View
Find Administrative Tools/Services

You're on your own after this, but in a nutshell.. you need to check the properties of the "Tomcat Service" and see if you can change the way the service "Logs On"

What happens when you reboot your computer? Do you have to restart Tomcat each time or is it still running after you reboot?


>Also startup.bat is not there in the specified directory.
Fine.  By the way, I never specified a directory because no one here knows how you've installed Tomcat 5.5.x
I'm very fond of version x myself.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
you said:

"You need to change that account to one that has access to your mdb.  You
can do that through the Services console.  Or try starting Tomcat via the
startup.bat file, that should launch Tomcat with the same account you've
logged into your system with, which hopefully is the same account you need
to for "Access".
"

I don't know how to do these...Can you explain for me? Also startup.bat is
not there in the specified directory.

On Sat, Apr 16, 2011 at 1:48 AM, Leo Donahue - PLANDEVX <
LeoDonahue@mail.maricopa.gov> wrote:

> >-----Original Message-----
> >From: RAHUL RAJ [mailto:omrahulrajcse@gmail.com]
> >Subject: Re: Working of Tomcat with MS Access
> >
> >Yes, it runs as a service. But how to know under what account does that
> >service run? does it mean 'admin' or 'normal user' or 'system'?
> >I made a system DSN for this...not the user DSN(Data Source Name)
> >and I launched tomcat service by right click 'run as admin'
>
> I'm really surprised you have had as many responses to this thread as
> you've had.
>
> Assuming you have Tomcat installed as a Windows service, usually the
> default account that runs Tomcat as a Windows service is "Local System
> Account".  You need to change that account to one that has access to your
> mdb.  You can do that through the Services console.  Or try starting Tomcat
> via the startup.bat file, that should launch Tomcat with the same account
> you've logged into your system with, which hopefully is the same account you
> need to for "Access".
>
> The code you posted should work, although I can't understand what the
> purpose of your assignment is.  Don't get in the habit of using this code
> for anything related to logging in, or anything else.
>
> If you must stay in the MS world, use SQL Express.
>
> try {
>        Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
>         Connection con =
> DriverManager.getConnection("jdbc:odbc:rahul","","");
>
>      Statement stmt =
> con.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);
>      String query = "Select whatever";
>
>      ResultSet rs = stmt.executeQuery(query);
>
>      while(rs.next()){
>           // do stuff
>        }
>        rs.close();
>      stmt.close();
>      con.close();
>    } catch(SQLException ex) {
>
>    } catch(java.lang.ClassNotFoundException jdbce) {
>
>    }
>
>

RE: Working of Tomcat with MS Access

Posted by Leo Donahue - PLANDEVX <Le...@mail.maricopa.gov>.
>-----Original Message-----
>From: RAHUL RAJ [mailto:omrahulrajcse@gmail.com]
>Subject: Re: Working of Tomcat with MS Access
>
>Yes, it runs as a service. But how to know under what account does that
>service run? does it mean 'admin' or 'normal user' or 'system'?
>I made a system DSN for this...not the user DSN(Data Source Name)
>and I launched tomcat service by right click 'run as admin'

I'm really surprised you have had as many responses to this thread as you've had.

Assuming you have Tomcat installed as a Windows service, usually the default account that runs Tomcat as a Windows service is "Local System Account".  You need to change that account to one that has access to your mdb.  You can do that through the Services console.  Or try starting Tomcat via the startup.bat file, that should launch Tomcat with the same account you've logged into your system with, which hopefully is the same account you need to for "Access".

The code you posted should work, although I can't understand what the purpose of your assignment is.  Don't get in the habit of using this code for anything related to logging in, or anything else.

If you must stay in the MS world, use SQL Express.

try {
        Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
        Connection con = DriverManager.getConnection("jdbc:odbc:rahul","","");

      Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);
      String query = "Select whatever";

      ResultSet rs = stmt.executeQuery(query);

      while(rs.next()){
          // do stuff
        }
        rs.close();
      stmt.close();
      con.close();
    } catch(SQLException ex) {

    } catch(java.lang.ClassNotFoundException jdbce) {

    }


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
Yes, it runs as a service. But how to know under what account does that
service run? does it mean 'admin' or 'normal user' or 'system'?
I made a system DSN for this...not the user DSN(Data Source Name)
and I launched tomcat service by right click 'run as admin'

On Fri, Apr 15, 2011 at 11:09 PM, Leo Donahue - PLANDEVX <
LeoDonahue@mail.maricopa.gov> wrote:

>
> >-----Original Message-----
> >From: RAHUL RAJ [mailto:omrahulrajcse@gmail.com]
> >Sent: Friday, April 15, 2011 10:35 AM
> >To: Tomcat Users List
> >Subject: Re: Working of Tomcat with MS Access
> >
> >Since I am a beginner, I have to start with some trial projects, right?
> >I
> >know this is nothing! and help me...pls answer to the "question.".
> >
>
> Mikolaj gave you a hint already.
>
> If your Tomcat runs as a service, under what account does that service run?
>  Does that account have access to your mdb?
>
> Did you create a user or system datasource on your computer with the name:
> rahul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Working of Tomcat with MS Access

Posted by Leo Donahue - PLANDEVX <Le...@mail.maricopa.gov>.
>-----Original Message-----
>From: RAHUL RAJ [mailto:omrahulrajcse@gmail.com]
>Sent: Friday, April 15, 2011 10:35 AM
>To: Tomcat Users List
>Subject: Re: Working of Tomcat with MS Access
>
>Since I am a beginner, I have to start with some trial projects, right?
>I
>know this is nothing! and help me...pls answer to the "question.".
>

Mikolaj gave you a hint already.

If your Tomcat runs as a service, under what account does that service run?  Does that account have access to your mdb?

Did you create a user or system datasource on your computer with the name: rahul 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: [OT] Working of Tomcat with MS Access

Posted by "Propes, Barry L " <ba...@citi.com>.
Oh, ok, that explains it better.

I've "had to" deal w/ MS Access, more than I'd like, or out of pure cheapness on my part sometimes, but have amply dealt with Oracle (best IMO) and SQL Server.

And no it's usually not.

I absolutely have to have MS Access solutions here, based in our corp. world, for quick reporting modules for people. They're always tethered to our Oracle ODBC connections, and lately I've been dealing with one that's not really that nice! : (

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net]
Sent: Friday, April 15, 2011 2:40 PM
To: Tomcat Users List
Subject: Re: [OT] Working of Tomcat with MS Access

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry,

On 4/15/2011 3:11 PM, Propes, Barry L wrote:
> Oh, ok - that's good. Although I'm not familiar with it, but will take
> it under advisement.

You could think of it as Java's answer to Access, except that I wouldn't want to be that demeaning of JavaDB (aka Apache Derby). It's transactional, which is I think more than you can say about MS Access files, but also file-based meaning that I think you can just copy a single file around and "move" the database. It's not usually that simple in the larger RDBMS world.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2onyoACgkQ9CaO5/Lv0PDgnACguZpmDV0+OLpe5poz7R8uhMS8
weIAn244//QAT/DvHhpEn3976U7cZJ7J
=Gsw6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Working of Tomcat with MS Access

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry,

On 4/15/2011 3:11 PM, Propes, Barry L wrote:
> Oh, ok - that's good. Although I'm not familiar with it, but will
> take it under advisement.

You could think of it as Java's answer to Access, except that I
wouldn't want to be that demeaning of JavaDB (aka Apache Derby). It's
transactional, which is I think more than you can say about MS Access
files, but also file-based meaning that I think you can just copy a
single file around and "move" the database. It's not usually that simple
in the larger RDBMS world.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2onyoACgkQ9CaO5/Lv0PDgnACguZpmDV0+OLpe5poz7R8uhMS8
weIAn244//QAT/DvHhpEn3976U7cZJ7J
=Gsw6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Working of Tomcat with MS Access

Posted by "Propes, Barry L " <ba...@citi.com>.
Oh, ok - that's good. Although I'm not familiar with it, but will take it under advisement.

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net]
Sent: Friday, April 15, 2011 2:03 PM
To: Tomcat Users List
Subject: Re: Working of Tomcat with MS Access

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry,

On 4/15/2011 1:56 PM, Propes, Barry L wrote:
> Like Jeff says, you can do this basically for no cost using both
> Tomcat and mySQL.

Even better, use JavaDB: it comes with Java and is pretty much guaranteed to work.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2olmwACgkQ9CaO5/Lv0PAFOwCgigjZqt/9QyFXXCg68L1A2cHk
PpYAoKK3VzrDZhRZiKlbFiqsmurJHd2l
=4sLQ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry,

On 4/15/2011 1:56 PM, Propes, Barry L wrote:
> Like Jeff says, you can do this basically for no cost using both
> Tomcat and mySQL.

Even better, use JavaDB: it comes with Java and is pretty much
guaranteed to work.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2olmwACgkQ9CaO5/Lv0PAFOwCgigjZqt/9QyFXXCg68L1A2cHk
PpYAoKK3VzrDZhRZiKlbFiqsmurJHd2l
=4sLQ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
No I am in Windows mode.

On Fri, Apr 15, 2011 at 11:26 PM, Propes, Barry L
<ba...@citi.com>wrote:

> Jeff has some really good points here, Rahul.
>
> I'm a guy who spent several years doing ASP development with both MS Access
> and SQL Server over the web before getting into Java.
> Even still, I didn't fathom trying to mess with MS Access with Java when I
> was making that transition. I started with mySQL on my Windows desktop to
> get started, but when I got access to our Oracle servers, went that route.
>
> Like Jeff says, you can do this basically for no cost using both Tomcat and
> mySQL.
>
> Sure, it's command line, unlike MS Access, but you shouldn't have too much
> trouble with it. Jeff, if he's using MS Access, he's probably not on Linux,
> is he?
>
>
> -----Original Message-----
> From: Jeff Hubbs [mailto:jhubbslist@att.net]
> Sent: Friday, April 15, 2011 12:46 PM
> To: Tomcat Users List
> Subject: Re: Working of Tomcat with MS Access
>
> A beginner needs to at least begin with workable platforms and software.
>  PostgreSQL on Linux has a total software license cost of $0.00; your
> barrier to entry with inappropriate software is considerably higher.
>
> On 4/15/11 1:35 PM, RAHUL RAJ wrote:
> > Since I am a beginner, I have to start with some trial projects,
> > right? I know this is nothing! and help me...pls answer to the
> "question.".
> >
> > On Fri, Apr 15, 2011 at 8:41 PM, Jeff Hubbs<jh...@att.net>  wrote:
> >
> >> You do realize, I hope, that what you're proposing is akin to
> >> sourcing parts for your jet engine from Fisher-Price?
> >>
> >> IMHO MS Access is not and never has been useful as a professional
> >> database product.  I'm not even sure if what you are proposing even
> >> holds up in the looking-through-binoculars-from-the-big-end sense.
> >>
> >> MS Access is a desktop application that accesses files on disk.  Java
> >> apps running on Tomcat typically access an RDBMS over a network
> >> connection via SQL statements and their responses.  AFAIK there is
> >> not a "server instantiation" of MS Access; in fact, part of the whole
> >> point of MS Access as an ongoing product is that it acts as a
> >> "gateway drug" to MS' SQL Server product, the transition to which
> >> would be triggered by the inherent limitations (and, in my past
> >> experience, persistent unaddressed bugs) of Access.
> >>
> >> I think you need to back up a bit and work toward getting your data
> >> liberated from MS Access and ported into a proper RDBMS like
> >> PostgreSQL or one of MS SQL Server, Oracle, IBM DB2, etc. if you feel
> >> that money must be continually spent on software licenses for such.
> >> Then you will be facing Java apps and Tomcat in a far more conventional
> way.
> >>
> >> So, to sum up this and earlier responses: 1) Learn to code Java 2)
> >> Understand real RDBMSses.
> >>
> >> - Jeff
> >>
> >>
> >> On 4/15/11 6:04 AM, RAHUL RAJ wrote:
> >>
> >>> Hello,
> >>>       I am working on  building a jsp website with MS Access as
> >>> database. When my login page is loaded on tomcat
> >>> (localhost:8080/login.jsp), it shows the following error:
> >>>
> >>> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
> >>> name not found and no default driver specified.
> >>>
> >>> The jdbc program alone is working perfectly, So There might not be
> >>> problems due to  Driver, Data source name, Database Tables or any
> >>> other software version compatibilities.
> >>>
> >>> OS: Windows Vista Home Basic
> >>> Tomcat Version: 5.5.x
> >>> jdk version: 1.6
> >>> MS Access 2010
> >>>
> >>>
> >>> code is given below:
> >>>
> >>> <%@ page language="java" import="java.sql.*" %>
> >>>   <html>
> >>>   <body>
> >>>   <form method="post">
> >>>   <p>   Enter your username :<input type="text" name="username"/>
> </p>
> >>>   <p>   Enter your password :<input type="text" name="password"/>
> </p>
> >>>   <input type="submit" value="Login"/>
> >>>   <%
> >>>      String usn = request.getParameter("username");
> >>>         String pass = request.getParameter("password");
> >>>
> >>>         try{
> >>>                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> >>>                  String url = "jdbc:odbc:rahul";
> >>>                  Connection con = DriverManager.getConnection(url, "",
> "");
> >>>                  Statement s = con.createStatement();
> >>>
> >>>                  ResultSet rs = s.executeQuery("select * from
> customers");
> >>>                  while(rs.next())
> >>>                  {
> >>>                    String u = rs.getString(1);
> >>>                    String p = rs.getString(2);
> >>>                    if(usn.equals(u)&&   pass.equals(p))
> >>>                    {
> >>>                       out.println("login successfull");
> >>>                           }
> >>>                    else
> >>>             {
> >>>                out.println("login failed");
> >>>               }
> >>>             }
> >>>          }
> >>>
> >>>                 catch(Exception e)
> >>>                 {
> >>>                    out.println("Error"+e);
> >>>                    }
> >>>
> >>>   %>
> >>>   </form>
> >>>   </body>
> >>>   </html>
> >>>
> >>> --------------------------------------------------------------------
> >>> - To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>> For additional commands, e-mail: users-help@tomcat.apache.org
> >>>
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Working of Tomcat with MS Access

Posted by "Propes, Barry L " <ba...@citi.com>.
Jeff has some really good points here, Rahul.

I'm a guy who spent several years doing ASP development with both MS Access and SQL Server over the web before getting into Java.
Even still, I didn't fathom trying to mess with MS Access with Java when I was making that transition. I started with mySQL on my Windows desktop to get started, but when I got access to our Oracle servers, went that route.

Like Jeff says, you can do this basically for no cost using both Tomcat and mySQL.

Sure, it's command line, unlike MS Access, but you shouldn't have too much trouble with it. Jeff, if he's using MS Access, he's probably not on Linux, is he?


-----Original Message-----
From: Jeff Hubbs [mailto:jhubbslist@att.net]
Sent: Friday, April 15, 2011 12:46 PM
To: Tomcat Users List
Subject: Re: Working of Tomcat with MS Access

A beginner needs to at least begin with workable platforms and software.  PostgreSQL on Linux has a total software license cost of $0.00; your barrier to entry with inappropriate software is considerably higher.

On 4/15/11 1:35 PM, RAHUL RAJ wrote:
> Since I am a beginner, I have to start with some trial projects,
> right? I know this is nothing! and help me...pls answer to the "question.".
>
> On Fri, Apr 15, 2011 at 8:41 PM, Jeff Hubbs<jh...@att.net>  wrote:
>
>> You do realize, I hope, that what you're proposing is akin to
>> sourcing parts for your jet engine from Fisher-Price?
>>
>> IMHO MS Access is not and never has been useful as a professional
>> database product.  I'm not even sure if what you are proposing even
>> holds up in the looking-through-binoculars-from-the-big-end sense.
>>
>> MS Access is a desktop application that accesses files on disk.  Java
>> apps running on Tomcat typically access an RDBMS over a network
>> connection via SQL statements and their responses.  AFAIK there is
>> not a "server instantiation" of MS Access; in fact, part of the whole
>> point of MS Access as an ongoing product is that it acts as a
>> "gateway drug" to MS' SQL Server product, the transition to which
>> would be triggered by the inherent limitations (and, in my past
>> experience, persistent unaddressed bugs) of Access.
>>
>> I think you need to back up a bit and work toward getting your data
>> liberated from MS Access and ported into a proper RDBMS like
>> PostgreSQL or one of MS SQL Server, Oracle, IBM DB2, etc. if you feel
>> that money must be continually spent on software licenses for such.
>> Then you will be facing Java apps and Tomcat in a far more conventional way.
>>
>> So, to sum up this and earlier responses: 1) Learn to code Java 2)
>> Understand real RDBMSses.
>>
>> - Jeff
>>
>>
>> On 4/15/11 6:04 AM, RAHUL RAJ wrote:
>>
>>> Hello,
>>>       I am working on  building a jsp website with MS Access as
>>> database. When my login page is loaded on tomcat
>>> (localhost:8080/login.jsp), it shows the following error:
>>>
>>> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
>>> name not found and no default driver specified.
>>>
>>> The jdbc program alone is working perfectly, So There might not be
>>> problems due to  Driver, Data source name, Database Tables or any
>>> other software version compatibilities.
>>>
>>> OS: Windows Vista Home Basic
>>> Tomcat Version: 5.5.x
>>> jdk version: 1.6
>>> MS Access 2010
>>>
>>>
>>> code is given below:
>>>
>>> <%@ page language="java" import="java.sql.*" %>
>>>   <html>
>>>   <body>
>>>   <form method="post">
>>>   <p>   Enter your username :<input type="text" name="username"/>   </p>
>>>   <p>   Enter your password :<input type="text" name="password"/>   </p>
>>>   <input type="submit" value="Login"/>
>>>   <%
>>>      String usn = request.getParameter("username");
>>>         String pass = request.getParameter("password");
>>>
>>>         try{
>>>                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>>>                  String url = "jdbc:odbc:rahul";
>>>                  Connection con = DriverManager.getConnection(url, "", "");
>>>                  Statement s = con.createStatement();
>>>
>>>                  ResultSet rs = s.executeQuery("select * from customers");
>>>                  while(rs.next())
>>>                  {
>>>                    String u = rs.getString(1);
>>>                    String p = rs.getString(2);
>>>                    if(usn.equals(u)&&   pass.equals(p))
>>>                    {
>>>                       out.println("login successfull");
>>>                           }
>>>                    else
>>>             {
>>>                out.println("login failed");
>>>               }
>>>             }
>>>          }
>>>
>>>                 catch(Exception e)
>>>                 {
>>>                    out.println("Error"+e);
>>>                    }
>>>
>>>   %>
>>>   </form>
>>>   </body>
>>>   </html>
>>>
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by Jeff Hubbs <jh...@att.net>.
A beginner needs to at least begin with workable platforms and 
software.  PostgreSQL on Linux has a total software license cost of 
$0.00; your barrier to entry with inappropriate software is considerably 
higher.

On 4/15/11 1:35 PM, RAHUL RAJ wrote:
> Since I am a beginner, I have to start with some trial projects, right? I
> know this is nothing! and help me...pls answer to the "question.".
>
> On Fri, Apr 15, 2011 at 8:41 PM, Jeff Hubbs<jh...@att.net>  wrote:
>
>> You do realize, I hope, that what you're proposing is akin to sourcing
>> parts for your jet engine from Fisher-Price?
>>
>> IMHO MS Access is not and never has been useful as a professional database
>> product.  I'm not even sure if what you are proposing even holds up in the
>> looking-through-binoculars-from-the-big-end sense.
>>
>> MS Access is a desktop application that accesses files on disk.  Java apps
>> running on Tomcat typically access an RDBMS over a network connection via
>> SQL statements and their responses.  AFAIK there is not a "server
>> instantiation" of MS Access; in fact, part of the whole point of MS Access
>> as an ongoing product is that it acts as a "gateway drug" to MS' SQL Server
>> product, the transition to which would be triggered by the inherent
>> limitations (and, in my past experience, persistent unaddressed bugs) of
>> Access.
>>
>> I think you need to back up a bit and work toward getting your data
>> liberated from MS Access and ported into a proper RDBMS like PostgreSQL or
>> one of MS SQL Server, Oracle, IBM DB2, etc. if you feel that money must be
>> continually spent on software licenses for such.  Then you will be facing
>> Java apps and Tomcat in a far more conventional way.
>>
>> So, to sum up this and earlier responses: 1) Learn to code Java 2)
>> Understand real RDBMSses.
>>
>> - Jeff
>>
>>
>> On 4/15/11 6:04 AM, RAHUL RAJ wrote:
>>
>>> Hello,
>>>       I am working on  building a jsp website with MS Access as
>>> database. When my login page is loaded on tomcat
>>> (localhost:8080/login.jsp), it shows the following error:
>>>
>>> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
>>> name not found and no default driver specified.
>>>
>>> The jdbc program alone is working perfectly, So There might not be
>>> problems due to  Driver, Data source name, Database Tables or any
>>> other software version compatibilities.
>>>
>>> OS: Windows Vista Home Basic
>>> Tomcat Version: 5.5.x
>>> jdk version: 1.6
>>> MS Access 2010
>>>
>>>
>>> code is given below:
>>>
>>> <%@ page language="java" import="java.sql.*" %>
>>>   <html>
>>>   <body>
>>>   <form method="post">
>>>   <p>   Enter your username :<input type="text" name="username"/>   </p>
>>>   <p>   Enter your password :<input type="text" name="password"/>   </p>
>>>   <input type="submit" value="Login"/>
>>>   <%
>>>      String usn = request.getParameter("username");
>>>         String pass = request.getParameter("password");
>>>
>>>         try{
>>>                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>>>                  String url = "jdbc:odbc:rahul";
>>>                  Connection con = DriverManager.getConnection(url, "", "");
>>>                  Statement s = con.createStatement();
>>>
>>>                  ResultSet rs = s.executeQuery("select * from customers");
>>>                  while(rs.next())
>>>                  {
>>>                    String u = rs.getString(1);
>>>                    String p = rs.getString(2);
>>>                    if(usn.equals(u)&&   pass.equals(p))
>>>                    {
>>>                       out.println("login successfull");
>>>                           }
>>>                    else
>>>             {
>>>                out.println("login failed");
>>>               }
>>>             }
>>>          }
>>>
>>>                 catch(Exception e)
>>>                 {
>>>                    out.println("Error"+e);
>>>                    }
>>>
>>>   %>
>>>   </form>
>>>   </body>
>>>   </html>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
Since I am a beginner, I have to start with some trial projects, right? I
know this is nothing! and help me...pls answer to the "question.".

On Fri, Apr 15, 2011 at 8:41 PM, Jeff Hubbs <jh...@att.net> wrote:

> You do realize, I hope, that what you're proposing is akin to sourcing
> parts for your jet engine from Fisher-Price?
>
> IMHO MS Access is not and never has been useful as a professional database
> product.  I'm not even sure if what you are proposing even holds up in the
> looking-through-binoculars-from-the-big-end sense.
>
> MS Access is a desktop application that accesses files on disk.  Java apps
> running on Tomcat typically access an RDBMS over a network connection via
> SQL statements and their responses.  AFAIK there is not a "server
> instantiation" of MS Access; in fact, part of the whole point of MS Access
> as an ongoing product is that it acts as a "gateway drug" to MS' SQL Server
> product, the transition to which would be triggered by the inherent
> limitations (and, in my past experience, persistent unaddressed bugs) of
> Access.
>
> I think you need to back up a bit and work toward getting your data
> liberated from MS Access and ported into a proper RDBMS like PostgreSQL or
> one of MS SQL Server, Oracle, IBM DB2, etc. if you feel that money must be
> continually spent on software licenses for such.  Then you will be facing
> Java apps and Tomcat in a far more conventional way.
>
> So, to sum up this and earlier responses: 1) Learn to code Java 2)
> Understand real RDBMSses.
>
> - Jeff
>
>
> On 4/15/11 6:04 AM, RAHUL RAJ wrote:
>
>> Hello,
>>      I am working on  building a jsp website with MS Access as
>> database. When my login page is loaded on tomcat
>> (localhost:8080/login.jsp), it shows the following error:
>>
>> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
>> name not found and no default driver specified.
>>
>> The jdbc program alone is working perfectly, So There might not be
>> problems due to  Driver, Data source name, Database Tables or any
>> other software version compatibilities.
>>
>> OS: Windows Vista Home Basic
>> Tomcat Version: 5.5.x
>> jdk version: 1.6
>> MS Access 2010
>>
>>
>> code is given below:
>>
>> <%@ page language="java" import="java.sql.*" %>
>>  <html>
>>  <body>
>>  <form method="post">
>>  <p>  Enter your username :<input type="text" name="username"/>  </p>
>>  <p>  Enter your password :<input type="text" name="password"/>  </p>
>>  <input type="submit" value="Login"/>
>>  <%
>>     String usn = request.getParameter("username");
>>        String pass = request.getParameter("password");
>>
>>        try{
>>                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>>                 String url = "jdbc:odbc:rahul";
>>                 Connection con = DriverManager.getConnection(url, "", "");
>>                 Statement s = con.createStatement();
>>
>>                 ResultSet rs = s.executeQuery("select * from customers");
>>                 while(rs.next())
>>                 {
>>                   String u = rs.getString(1);
>>                   String p = rs.getString(2);
>>                   if(usn.equals(u)&&  pass.equals(p))
>>                   {
>>                      out.println("login successfull");
>>                          }
>>                   else
>>            {
>>               out.println("login failed");
>>              }
>>            }
>>         }
>>
>>                catch(Exception e)
>>                {
>>                   out.println("Error"+e);
>>                   }
>>
>>  %>
>>  </form>
>>  </body>
>>  </html>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Working of Tomcat with MS Access

Posted by Jeff Hubbs <jh...@att.net>.
You do realize, I hope, that what you're proposing is akin to sourcing 
parts for your jet engine from Fisher-Price?

IMHO MS Access is not and never has been useful as a professional 
database product.  I'm not even sure if what you are proposing even 
holds up in the looking-through-binoculars-from-the-big-end sense.

MS Access is a desktop application that accesses files on disk.  Java 
apps running on Tomcat typically access an RDBMS over a network 
connection via SQL statements and their responses.  AFAIK there is not a 
"server instantiation" of MS Access; in fact, part of the whole point of 
MS Access as an ongoing product is that it acts as a "gateway drug" to 
MS' SQL Server product, the transition to which would be triggered by 
the inherent limitations (and, in my past experience, persistent 
unaddressed bugs) of Access.

I think you need to back up a bit and work toward getting your data 
liberated from MS Access and ported into a proper RDBMS like PostgreSQL 
or one of MS SQL Server, Oracle, IBM DB2, etc. if you feel that money 
must be continually spent on software licenses for such.  Then you will 
be facing Java apps and Tomcat in a far more conventional way.

So, to sum up this and earlier responses: 1) Learn to code Java 2) 
Understand real RDBMSses.

- Jeff

On 4/15/11 6:04 AM, RAHUL RAJ wrote:
> Hello,
>       I am working on  building a jsp website with MS Access as
> database. When my login page is loaded on tomcat
> (localhost:8080/login.jsp), it shows the following error:
>
> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
> name not found and no default driver specified.
>
> The jdbc program alone is working perfectly, So There might not be
> problems due to  Driver, Data source name, Database Tables or any
> other software version compatibilities.
>
> OS: Windows Vista Home Basic
> Tomcat Version: 5.5.x
> jdk version: 1.6
> MS Access 2010
>
>
> code is given below:
>
> <%@ page language="java" import="java.sql.*" %>
>   <html>
>   <body>
>   <form method="post">
>   <p>  Enter your username :<input type="text" name="username"/>  </p>
>   <p>  Enter your password :<input type="text" name="password"/>  </p>
>   <input type="submit" value="Login"/>
>   <%
>      String usn = request.getParameter("username");
> 	String pass = request.getParameter("password");
>
> 	try{
> 	         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> 		 String url = "jdbc:odbc:rahul";
> 		 Connection con = DriverManager.getConnection(url, "", "");
> 		 Statement s = con.createStatement();
> 		
> 		 ResultSet rs = s.executeQuery("select * from customers");
> 		 while(rs.next())
> 		 {
> 		   String u = rs.getString(1);
> 		   String p = rs.getString(2);
> 		   if(usn.equals(u)&&  pass.equals(p))
> 		   {
> 		      out.println("login successfull");
> 			  }
> 		   else
>             {
>                out.println("login failed");
>               }
>             }
>          }
> 		
> 		catch(Exception e)
> 		{
> 		   out.println("Error"+e);
> 		   }
>   			
>   %>
>   </form>
>   </body>
>   </html>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Working of Tomcat with MS Access

Posted by "Propes, Barry L " <ba...@citi.com>.
I know from previous experience that driver you show is horribly outdated, and horrible in general.

I assume no credentials are needed to access the DB in the Connection  object, con?

Maybe I'm reading that incorrectly.

Does the JDBC program connect to MS Access at all?


-----Original Message-----
From: RAHUL RAJ [mailto:omrahulrajcse@gmail.com]
Sent: Friday, April 15, 2011 5:05 AM
To: users@tomcat.apache.org
Subject: Working of Tomcat with MS Access

Hello,
     I am working on  building a jsp website with MS Access as database. When my login page is loaded on tomcat (localhost:8080/login.jsp), it shows the following error:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

The jdbc program alone is working perfectly, So There might not be problems due to  Driver, Data source name, Database Tables or any other software version compatibilities.

OS: Windows Vista Home Basic
Tomcat Version: 5.5.x
jdk version: 1.6
MS Access 2010


code is given below:

<%@ page language="java" import="java.sql.*" %>  <html>  <body>  <form method="post">  <p> Enter your username :  <input type="text" name="username"/> </p>  <p> Enter your password :  <input type="text" name="password"/> </p>  <input type="submit" value="Login"/>  <%
    String usn = request.getParameter("username");
        String pass = request.getParameter("password");

        try{
                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                 String url = "jdbc:odbc:rahul";
                 Connection con = DriverManager.getConnection(url, "", "");
                 Statement s = con.createStatement();

                 ResultSet rs = s.executeQuery("select * from customers");
                 while(rs.next())
                 {
                   String u = rs.getString(1);
                   String p = rs.getString(2);
                   if(usn.equals(u) && pass.equals(p))
                   {
                      out.println("login successfull");
                          }
                   else
           {
              out.println("login failed");
             }
           }
        }

                catch(Exception e)
                {
                   out.println("Error"+e);
                   }

 %>
 </form>
 </body>
 </html>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
The code I gave is just a sample code, it might change afterwards..but
before that, I need to resolve this error, sorry for your
inconvenience...

On 4/15/11, RAHUL RAJ <om...@gmail.com> wrote:
> I know my code is not perfect.
> But I just want to resolve this error now. Can u say how to solve
> this? pls answer to the question.....have u read my message
> completely?
>
> On 4/15/11, Mikolaj Rydzewski <mi...@ceti.pl> wrote:
>>
>>  On Fri, 15 Apr 2011 15:34:37 +0530, RAHUL RAJ <om...@gmail.com>
>>  wrote:
>>
>>>      I am working on  building a jsp website with MS Access as
>>> database.
>>
>>  I usually do not express my opinions about others code, but your is
>>  really the worst code sample I have ever seen...
>>  I know that everyone has its time to begin. But please use some good
>>  book to start with.
>>
>>  1. use newer tomcat
>>  2. do not mix code and html
>>  3. instantiate jdbc driver once
>>  4. close jdbc connections (within finally block) after use
>>  5. use where sql clause
>>  6. use better database
>>  7. perform username&password check only after form submission
>>  8. use any framework/library to wrap jdbc calls
>>  9. ....
>>
>> --
>>  Mikolaj Rydzewski <mi...@ceti.pl>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
 On Fri, 15 Apr 2011 17:01:05 +0530, RAHUL RAJ <om...@gmail.com> 
 wrote:
> I know my code is not perfect.
> But I just want to resolve this error now. Can u say how to solve
> this? pls answer to the question.....have u read my message
> completely?

 How do you run your tomcat - as a service?

-- 
 Mikolaj Rydzewski <mi...@ceti.pl>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
I know my code is not perfect.
But I just want to resolve this error now. Can u say how to solve
this? pls answer to the question.....have u read my message
completely?

On 4/15/11, Mikolaj Rydzewski <mi...@ceti.pl> wrote:
>
>  On Fri, 15 Apr 2011 15:34:37 +0530, RAHUL RAJ <om...@gmail.com>
>  wrote:
>
>>      I am working on  building a jsp website with MS Access as
>> database.
>
>  I usually do not express my opinions about others code, but your is
>  really the worst code sample I have ever seen...
>  I know that everyone has its time to begin. But please use some good
>  book to start with.
>
>  1. use newer tomcat
>  2. do not mix code and html
>  3. instantiate jdbc driver once
>  4. close jdbc connections (within finally block) after use
>  5. use where sql clause
>  6. use better database
>  7. perform username&password check only after form submission
>  8. use any framework/library to wrap jdbc calls
>  9. ....
>
> --
>  Mikolaj Rydzewski <mi...@ceti.pl>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
 On Fri, 15 Apr 2011 15:34:37 +0530, RAHUL RAJ <om...@gmail.com> 
 wrote:

>      I am working on  building a jsp website with MS Access as
> database.

 I usually do not express my opinions about others code, but your is 
 really the worst code sample I have ever seen...
 I know that everyone has its time to begin. But please use some good 
 book to start with.

 1. use newer tomcat
 2. do not mix code and html
 3. instantiate jdbc driver once
 4. close jdbc connections (within finally block) after use
 5. use where sql clause
 6. use better database
 7. perform username&password check only after form submission
 8. use any framework/library to wrap jdbc calls
 9. ....

-- 
 Mikolaj Rydzewski <mi...@ceti.pl>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
Yes I already did , that  you might think I should. Now I am trying with MS
ACCESS...and new error came : SQLException: general error
I didn't found any error in my  sql syntax or jdbc code. jdbc code alone is
working perfectly..

On Fri, Apr 15, 2011 at 9:02 PM, Angel Java Lopez <aj...@gmail.com>wrote:

> One question:
>
> You should have an ODBC declaration named "rahul". It is declared for your
> user, or as a system odbc name? My guess, your Tomcat is running as a
> service, or under other user (not your user), and ODBC "rahul" Data Source
> name is only for your user.
>
> Is it the case?
>
> Did you solve the problem? How?
>
> Angel "Java" Lopez
> http://www.ajlopez.com
> http://twitter.com/ajlopez
>
> On Fri, Apr 15, 2011 at 7:04 AM, RAHUL RAJ <om...@gmail.com>
> wrote:
>
> > Hello,
> >     I am working on  building a jsp website with MS Access as
> > database. When my login page is loaded on tomcat
> > (localhost:8080/login.jsp), it shows the following error:
> >
> > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
> > name not found and no default driver specified.
> >
> > The jdbc program alone is working perfectly, So There might not be
> > problems due to  Driver, Data source name, Database Tables or any
> > other software version compatibilities.
> >
> > OS: Windows Vista Home Basic
> > Tomcat Version: 5.5.x
> > jdk version: 1.6
> > MS Access 2010
> >
> >
> > code is given below:
> >
> > <%@ page language="java" import="java.sql.*" %>
> >  <html>
> >  <body>
> >  <form method="post">
> >  <p> Enter your username :  <input type="text" name="username"/> </p>
> >  <p> Enter your password :  <input type="text" name="password"/> </p>
> >  <input type="submit" value="Login"/>
> >  <%
> >    String usn = request.getParameter("username");
> >        String pass = request.getParameter("password");
> >
> >        try{
> >                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> >                 String url = "jdbc:odbc:rahul";
> >                 Connection con = DriverManager.getConnection(url, "",
> "");
> >                 Statement s = con.createStatement();
> >
> >                 ResultSet rs = s.executeQuery("select * from customers");
> >                 while(rs.next())
> >                 {
> >                   String u = rs.getString(1);
> >                   String p = rs.getString(2);
> >                   if(usn.equals(u) && pass.equals(p))
> >                   {
> >                      out.println("login successfull");
> >                          }
> >                   else
> >           {
> >              out.println("login failed");
> >             }
> >           }
> >        }
> >
> >                catch(Exception e)
> >                {
> >                   out.println("Error"+e);
> >                   }
> >
> >  %>
> >  </form>
> >  </body>
> >  </html>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>

Re: Working of Tomcat with MS Access

Posted by Angel Java Lopez <aj...@gmail.com>.
One question:

You should have an ODBC declaration named "rahul". It is declared for your
user, or as a system odbc name? My guess, your Tomcat is running as a
service, or under other user (not your user), and ODBC "rahul" Data Source
name is only for your user.

Is it the case?

Did you solve the problem? How?

Angel "Java" Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

On Fri, Apr 15, 2011 at 7:04 AM, RAHUL RAJ <om...@gmail.com> wrote:

> Hello,
>     I am working on  building a jsp website with MS Access as
> database. When my login page is loaded on tomcat
> (localhost:8080/login.jsp), it shows the following error:
>
> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
> name not found and no default driver specified.
>
> The jdbc program alone is working perfectly, So There might not be
> problems due to  Driver, Data source name, Database Tables or any
> other software version compatibilities.
>
> OS: Windows Vista Home Basic
> Tomcat Version: 5.5.x
> jdk version: 1.6
> MS Access 2010
>
>
> code is given below:
>
> <%@ page language="java" import="java.sql.*" %>
>  <html>
>  <body>
>  <form method="post">
>  <p> Enter your username :  <input type="text" name="username"/> </p>
>  <p> Enter your password :  <input type="text" name="password"/> </p>
>  <input type="submit" value="Login"/>
>  <%
>    String usn = request.getParameter("username");
>        String pass = request.getParameter("password");
>
>        try{
>                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>                 String url = "jdbc:odbc:rahul";
>                 Connection con = DriverManager.getConnection(url, "", "");
>                 Statement s = con.createStatement();
>
>                 ResultSet rs = s.executeQuery("select * from customers");
>                 while(rs.next())
>                 {
>                   String u = rs.getString(1);
>                   String p = rs.getString(2);
>                   if(usn.equals(u) && pass.equals(p))
>                   {
>                      out.println("login successfull");
>                          }
>                   else
>           {
>              out.println("login failed");
>             }
>           }
>        }
>
>                catch(Exception e)
>                {
>                   out.println("Error"+e);
>                   }
>
>  %>
>  </form>
>  </body>
>  </html>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Working of Tomcat with MS Access

Posted by Jeff Hubbs <jh...@att.net>.
MySQL is indeed another good Open Source RDBMS; I would not call it 
"lightweight" in that it is used to power some mighty big Web apps, but 
the implementation does seem a little quaint.

On 4/15/11 11:38 AM, Troy wrote:
> Raj;
>
> To all reading this response, this is my first response on this list so if I get it a little wrong have patience.
>
> You may want to look at the light weight RDBMS mysql.  It is free, easily installed and can be utilized with the companion Workbench to make dealing with the db very easy, a lot like the access interface.  You will have good driver support from the java end as well and a lot of documentation and tutorials to get you connected in your web app to your persistence layer.
>
> mysql.com
>
> Just my two cents and an attempt to give back a little to the community.
>
> Troy
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: RAHUL RAJ<om...@gmail.com>
> To: users<us...@tomcat.apache.org>
> Sent: Fri, Apr 15, 2011 6:05 am
> Subject: Working of Tomcat with MS Access
>
>
> Hello,
>
>       I am working on  building a jsp website with MS Access as
>
> database. When my login page is loaded on tomcat
>
> (localhost:8080/login.jsp), it shows the following error:
>
>
>
> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
>
> name not found and no default driver specified.
>
>
>
> The jdbc program alone is working perfectly, So There might not be
>
> problems due to  Driver, Data source name, Database Tables or any
>
> other software version compatibilities.
>
>
>
> OS: Windows Vista Home Basic
>
> Tomcat Version: 5.5.x
>
> jdk version: 1.6
>
> MS Access 2010
>
>
>
>
>
> code is given below:
>
>
>
> <%@ page language="java" import="java.sql.*" %>
>
>   <html>
>
>   <body>
>
>   <form method="post">
>
>   <p>  Enter your username :<input type="text" name="username"/>  </p>
>
>   <p>  Enter your password :<input type="text" name="password"/>  </p>
>
>   <input type="submit" value="Login"/>
>
>   <%
>
>      String usn = request.getParameter("username");
>
> 	String pass = request.getParameter("password");
>
>
>
> 	try{
>
> 	         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>
> 		 String url = "jdbc:odbc:rahul";
>
> 		 Connection con = DriverManager.getConnection(url, "", "");
>
> 		 Statement s = con.createStatement();
>
> 		
>
> 		 ResultSet rs = s.executeQuery("select * from customers");
>
> 		 while(rs.next())
>
> 		 {
>
> 		   String u = rs.getString(1);
>
> 		   String p = rs.getString(2);
>
> 		   if(usn.equals(u)&&  pass.equals(p))
>
> 		   {
>
> 		      out.println("login successfull");
>
> 			  }
>
> 		   else
>
>             {
>
>                out.println("login failed");
>
>               }
>
>             }
>
>          }
>
> 		
>
> 		catch(Exception e)
>
> 		{
>
> 		   out.println("Error"+e);
>
> 		   }
>
>   			
>
>   %>
>
>   </form>
>
>   </body>
>
>   </html>
>
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
There is no startup.bat file in the directory u specified.

In my system the directory path is
C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin


On Sat, Apr 16, 2011 at 12:14 AM, Angel Java Lopez <aj...@gmail.com>wrote:

> Rahul:
>
> Stop tomcat as a service.
> Go to /<tomcatdir>/bin
> Run startup.bat
> Try your app again.
>
> Only to discard user account/access problems.
>
> On Fri, Apr 15, 2011 at 3:13 PM, RAHUL RAJ <om...@gmail.com>
> wrote:
>
> > running 'tomcat as standalone java program'? can u explain for me sir?
> >
> > 2011/4/15 Mikolaj Rydzewski <mi...@ceti.pl>
> >
> > > RAHUL RAJ wrote:
> > >
> > >> This is like a small assignment that has to be submitted urgently..so
> I
> > >> have
> > >> to run away from the error! and tried with MS ACCESS.
> > >> The jdbc program for access works perfect alone..
> > >>
> > >>
> > > So run tomcat as a 'standalone' java program - that means not as a
> > service.
> > >
> > >
> > > --
> > > Mikolaj Rydzewski <mi...@ceti.pl>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
> >
>

Re: Working of Tomcat with MS Access

Posted by Angel Java Lopez <aj...@gmail.com>.
Rahul:

Stop tomcat as a service.
Go to /<tomcatdir>/bin
Run startup.bat
Try your app again.

Only to discard user account/access problems.

On Fri, Apr 15, 2011 at 3:13 PM, RAHUL RAJ <om...@gmail.com> wrote:

> running 'tomcat as standalone java program'? can u explain for me sir?
>
> 2011/4/15 Mikolaj Rydzewski <mi...@ceti.pl>
>
> > RAHUL RAJ wrote:
> >
> >> This is like a small assignment that has to be submitted urgently..so I
> >> have
> >> to run away from the error! and tried with MS ACCESS.
> >> The jdbc program for access works perfect alone..
> >>
> >>
> > So run tomcat as a 'standalone' java program - that means not as a
> service.
> >
> >
> > --
> > Mikolaj Rydzewski <mi...@ceti.pl>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>

Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
running 'tomcat as standalone java program'? can u explain for me sir?

2011/4/15 Mikolaj Rydzewski <mi...@ceti.pl>

> RAHUL RAJ wrote:
>
>> This is like a small assignment that has to be submitted urgently..so I
>> have
>> to run away from the error! and tried with MS ACCESS.
>> The jdbc program for access works perfect alone..
>>
>>
> So run tomcat as a 'standalone' java program - that means not as a service.
>
>
> --
> Mikolaj Rydzewski <mi...@ceti.pl>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Working of Tomcat with MS Access

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
RAHUL RAJ wrote:
> This is like a small assignment that has to be submitted urgently..so I have
> to run away from the error! and tried with MS ACCESS.
> The jdbc program for access works perfect alone..
>   
So run tomcat as a 'standalone' java program - that means not as a service.

-- 
Mikolaj Rydzewski <mi...@ceti.pl>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
Yes of course...I did the same...then what to do with this error? Remember
that Now I am working in ACCESS. code is not much different...

On Sat, Apr 16, 2011 at 12:10 AM, Troy <tr...@aol.com> wrote:

> I believe the drivers should be located in: YourApp/WEB-INF/lib/
>
>
> Troy
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: RAHUL RAJ <om...@gmail.com>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Fri, Apr 15, 2011 2:35 pm
> Subject: Re: Working of Tomcat with MS Access
>
>
> Thank you very much for your help! When I did with mysql, the corresponding
>
> jdbc driver is stored in /webapps/ROOT/lib directory in tomcat.
>
>
>
> On Fri, Apr 15, 2011 at 11:56 PM, Troy <tr...@aol.com> wrote:
>
>
>
> > I wrote a quick little jsp to access one of my db (a mysql)
>
> >
>
> >
>
> > <%@page contentType="text/html" pageEncoding="UTF-8"%>
>
> > <%@page import="java.sql.*" %>
>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>
> >   "http://www.w3.org/TR/html4/loose.dtd">
>
> >
>
> > <html>
>
> >    <head>
>
> >        <meta http-equiv="Content-Type" content="text/html;
> charset=UTF-8">
>
> >        <title>Test Connection</title>
>
> >    </head>
>
> >    <body>
>
> >
>
> >        <%
>
> >        String name = "";
>
> >        Class.forName("com.mysql.jdbc.Driver");
>
> >        Connection conn =
>
> > DriverManager.getConnection("jdbc:mysql://localhost/dbName", "XXXX",
>
> > "XXXXXX");
>
> >        Statement stmt = conn.createStatement();
>
> >        String query = "select * from friends where id='1'";
>
> >        ResultSet rs = stmt.executeQuery(query);
>
> >        while(rs.next()){
>
> >         name = rs.getString(3);
>
> >        }
>
> >
>
> > %>
>
> >
>
> > <%= name %>
>
> >
>
> >    </body>
>
> > </html>
>
> >
>
> > Worked like expected.  I know this is not a java thread . . . but still
>
> > trying to help since it is a time sensitive matter.
>
> > Silly question, but are your jdbc drivers added to your library for the
> web
>
> > app?  I make this mistake ALL the time.
>
> >
>
> > Troy
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > -----Original Message-----
>
> > From: RAHUL RAJ <om...@gmail.com>
>
> > To: Tomcat Users List <us...@tomcat.apache.org>
>
> > Sent: Fri, Apr 15, 2011 1:59 pm
>
> > Subject: Re: Working of Tomcat with MS Access
>
> >
>
> >
>
> > ya...I did the same thing  you told in mysql...but communications
> Exception
>
> >
>
> > occured..
>
> >
>
> > This is like a small assignment that has to be submitted urgently..so I
>
> > have
>
> >
>
> > to run away from the error! and tried with MS ACCESS.
>
> >
>
> > The jdbc program for access works perfect alone..
>
> >
>
> >
>
> >
>
> > On Fri, Apr 15, 2011 at 11:19 PM, Troy <tr...@aol.com> wrote:
>
> >
>
> >
>
> >
>
> > > Raj,
>
> >
>
> > >
>
> >
>
> > > I think everyone is saying to take a look at this syntax:
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > >String url = "jdbc:odbc:rahul";
>
> >
>
> > > >                Connection con = DriverManager.getConnection(url, "",
>
> > "");
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > I know that when I make this type of simple jdbc connection in mysql
> the
>
> >
>
> > > syntax is:
>
> >
>
> > >
>
> >
>
> > > String url = "jdbc:mysql://localhost/dbName";
>
> >
>
> > > Connection conn = DriverManager.getConnection(url, "", "");
>
> >
>
> > >
>
> >
>
> > > Troy
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > -----Original Message-----
>
> >
>
> > > From: RAHUL RAJ <om...@gmail.com>
>
> >
>
> > > To: Tomcat Users List <us...@tomcat.apache.org>
>
> >
>
> > > Sent: Fri, Apr 15, 2011 1:31 pm
>
> >
>
> > > Subject: Re: Working of Tomcat with MS Access
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > I got communications exception when I did this with mysql...and no one
>
> >
>
> > > knows
>
> >
>
> > >
>
> >
>
> > > the reason perfectly...no response from mysql forum too...
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > On Fri, Apr 15, 2011 at 9:08 PM, Troy <tr...@aol.com> wrote:
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > > Raj;
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > To all reading this response, this is my first response on this list
> so
>
> >
>
> > > if
>
> >
>
> > >
>
> >
>
> > > > I get it a little wrong have patience.
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > You may want to look at the light weight RDBMS mysql.  It is free,
>
> > easily
>
> >
>
> > >
>
> >
>
> > > > installed and can be utilized with the companion Workbench to make
>
> >
>
> > > dealing
>
> >
>
> > >
>
> >
>
> > > > with the db very easy, a lot like the access interface.  You will
> have
>
> >
>
> > > good
>
> >
>
> > >
>
> >
>
> > > > driver support from the java end as well and a lot of documentation
> and
>
> >
>
> > >
>
> >
>
> > > > tutorials to get you connected in your web app to your persistence
>
> > layer.
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > mysql.com
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > Just my two cents and an attempt to give back a little to the
>
> > community.
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > Troy
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > -----Original Message-----
>
> >
>
> > >
>
> >
>
> > > > From: RAHUL RAJ <om...@gmail.com>
>
> >
>
> > >
>
> >
>
> > > > To: users <us...@tomcat.apache.org>
>
> >
>
> > >
>
> >
>
> > > > Sent: Fri, Apr 15, 2011 6:05 am
>
> >
>
> > >
>
> >
>
> > > > Subject: Working of Tomcat with MS Access
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > Hello,
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >     I am working on  building a jsp website with MS Access as
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > database. When my login page is loaded on tomcat
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > (localhost:8080/login.jsp), it shows the following error:
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > name not found and no default driver specified.
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > The jdbc program alone is working perfectly, So There might not be
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > problems due to  Driver, Data source name, Database Tables or any
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > other software version compatibilities.
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > OS: Windows Vista Home Basic
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > Tomcat Version: 5.5.x
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > jdk version: 1.6
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > MS Access 2010
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > code is given below:
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > <%@ page language="java" import="java.sql.*" %>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  <html>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  <body>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  <form method="post">
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  <p> Enter your username :  <input type="text" name="username"/> </p>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  <p> Enter your password :  <input type="text" name="password"/> </p>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  <input type="submit" value="Login"/>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  <%
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >    String usn = request.getParameter("username");
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >        String pass = request.getParameter("password");
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >        try{
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                 String url = "jdbc:odbc:rahul";
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                 Connection con = DriverManager.getConnection(url, "",
>
> >
>
> > > "");
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                 Statement s = con.createStatement();
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                 ResultSet rs = s.executeQuery("select * from
>
> > customers");
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                 while(rs.next())
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                 {
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                   String u = rs.getString(1);
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                   String p = rs.getString(2);
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                   if(usn.equals(u) && pass.equals(p))
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                   {
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                      out.println("login successfull");
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                          }
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                   else
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >           {
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >              out.println("login failed");
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >             }
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >           }
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >        }
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                catch(Exception e)
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                {
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                   out.println("Error"+e);
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >                   }
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  %>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  </form>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  </body>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >  </html>
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > ---------------------------------------------------------------------
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > > For additional commands, e-mail: users-help@tomcat.apache.org
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> >
>
> >
>
> >
>
>
>
>

Re: Working of Tomcat with MS Access

Posted by Troy <tr...@aol.com>.
I believe the drivers should be located in: YourApp/WEB-INF/lib/
 

Troy

 


 

 

-----Original Message-----
From: RAHUL RAJ <om...@gmail.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Fri, Apr 15, 2011 2:35 pm
Subject: Re: Working of Tomcat with MS Access


Thank you very much for your help! When I did with mysql, the corresponding

jdbc driver is stored in /webapps/ROOT/lib directory in tomcat.



On Fri, Apr 15, 2011 at 11:56 PM, Troy <tr...@aol.com> wrote:



> I wrote a quick little jsp to access one of my db (a mysql)

>

>

> <%@page contentType="text/html" pageEncoding="UTF-8"%>

> <%@page import="java.sql.*" %>

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

>   "http://www.w3.org/TR/html4/loose.dtd">

>

> <html>

>    <head>

>        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

>        <title>Test Connection</title>

>    </head>

>    <body>

>

>        <%

>        String name = "";

>        Class.forName("com.mysql.jdbc.Driver");

>        Connection conn =

> DriverManager.getConnection("jdbc:mysql://localhost/dbName", "XXXX",

> "XXXXXX");

>        Statement stmt = conn.createStatement();

>        String query = "select * from friends where id='1'";

>        ResultSet rs = stmt.executeQuery(query);

>        while(rs.next()){

>         name = rs.getString(3);

>        }

>

> %>

>

> <%= name %>

>

>    </body>

> </html>

>

> Worked like expected.  I know this is not a java thread . . . but still

> trying to help since it is a time sensitive matter.

> Silly question, but are your jdbc drivers added to your library for the web

> app?  I make this mistake ALL the time.

>

> Troy

>

>

>

>

>

>

>

>

>

>

> -----Original Message-----

> From: RAHUL RAJ <om...@gmail.com>

> To: Tomcat Users List <us...@tomcat.apache.org>

> Sent: Fri, Apr 15, 2011 1:59 pm

> Subject: Re: Working of Tomcat with MS Access

>

>

> ya...I did the same thing  you told in mysql...but communications Exception

>

> occured..

>

> This is like a small assignment that has to be submitted urgently..so I

> have

>

> to run away from the error! and tried with MS ACCESS.

>

> The jdbc program for access works perfect alone..

>

>

>

> On Fri, Apr 15, 2011 at 11:19 PM, Troy <tr...@aol.com> wrote:

>

>

>

> > Raj,

>

> >

>

> > I think everyone is saying to take a look at this syntax:

>

> >

>

> >

>

> > >String url = "jdbc:odbc:rahul";

>

> > >                Connection con = DriverManager.getConnection(url, "",

> "");

>

> >

>

> >

>

> > I know that when I make this type of simple jdbc connection in mysql the

>

> > syntax is:

>

> >

>

> > String url = "jdbc:mysql://localhost/dbName";

>

> > Connection conn = DriverManager.getConnection(url, "", "");

>

> >

>

> > Troy

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> > -----Original Message-----

>

> > From: RAHUL RAJ <om...@gmail.com>

>

> > To: Tomcat Users List <us...@tomcat.apache.org>

>

> > Sent: Fri, Apr 15, 2011 1:31 pm

>

> > Subject: Re: Working of Tomcat with MS Access

>

> >

>

> >

>

> > I got communications exception when I did this with mysql...and no one

>

> > knows

>

> >

>

> > the reason perfectly...no response from mysql forum too...

>

> >

>

> >

>

> >

>

> > On Fri, Apr 15, 2011 at 9:08 PM, Troy <tr...@aol.com> wrote:

>

> >

>

> >

>

> >

>

> > > Raj;

>

> >

>

> > >

>

> >

>

> > > To all reading this response, this is my first response on this list so

>

> > if

>

> >

>

> > > I get it a little wrong have patience.

>

> >

>

> > >

>

> >

>

> > > You may want to look at the light weight RDBMS mysql.  It is free,

> easily

>

> >

>

> > > installed and can be utilized with the companion Workbench to make

>

> > dealing

>

> >

>

> > > with the db very easy, a lot like the access interface.  You will have

>

> > good

>

> >

>

> > > driver support from the java end as well and a lot of documentation and

>

> >

>

> > > tutorials to get you connected in your web app to your persistence

> layer.

>

> >

>

> > >

>

> >

>

> > > mysql.com

>

> >

>

> > >

>

> >

>

> > > Just my two cents and an attempt to give back a little to the

> community.

>

> >

>

> > >

>

> >

>

> > > Troy

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > > -----Original Message-----

>

> >

>

> > > From: RAHUL RAJ <om...@gmail.com>

>

> >

>

> > > To: users <us...@tomcat.apache.org>

>

> >

>

> > > Sent: Fri, Apr 15, 2011 6:05 am

>

> >

>

> > > Subject: Working of Tomcat with MS Access

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > > Hello,

>

> >

>

> > >

>

> >

>

> > >     I am working on  building a jsp website with MS Access as

>

> >

>

> > >

>

> >

>

> > > database. When my login page is loaded on tomcat

>

> >

>

> > >

>

> >

>

> > > (localhost:8080/login.jsp), it shows the following error:

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source

>

> >

>

> > >

>

> >

>

> > > name not found and no default driver specified.

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > > The jdbc program alone is working perfectly, So There might not be

>

> >

>

> > >

>

> >

>

> > > problems due to  Driver, Data source name, Database Tables or any

>

> >

>

> > >

>

> >

>

> > > other software version compatibilities.

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > > OS: Windows Vista Home Basic

>

> >

>

> > >

>

> >

>

> > > Tomcat Version: 5.5.x

>

> >

>

> > >

>

> >

>

> > > jdk version: 1.6

>

> >

>

> > >

>

> >

>

> > > MS Access 2010

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > > code is given below:

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > > <%@ page language="java" import="java.sql.*" %>

>

> >

>

> > >

>

> >

>

> > >  <html>

>

> >

>

> > >

>

> >

>

> > >  <body>

>

> >

>

> > >

>

> >

>

> > >  <form method="post">

>

> >

>

> > >

>

> >

>

> > >  <p> Enter your username :  <input type="text" name="username"/> </p>

>

> >

>

> > >

>

> >

>

> > >  <p> Enter your password :  <input type="text" name="password"/> </p>

>

> >

>

> > >

>

> >

>

> > >  <input type="submit" value="Login"/>

>

> >

>

> > >

>

> >

>

> > >  <%

>

> >

>

> > >

>

> >

>

> > >    String usn = request.getParameter("username");

>

> >

>

> > >

>

> >

>

> > >        String pass = request.getParameter("password");

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >        try{

>

> >

>

> > >

>

> >

>

> > >                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

>

> >

>

> > >

>

> >

>

> > >                 String url = "jdbc:odbc:rahul";

>

> >

>

> > >

>

> >

>

> > >                 Connection con = DriverManager.getConnection(url, "",

>

> > "");

>

> >

>

> > >

>

> >

>

> > >                 Statement s = con.createStatement();

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >                 ResultSet rs = s.executeQuery("select * from

> customers");

>

> >

>

> > >

>

> >

>

> > >                 while(rs.next())

>

> >

>

> > >

>

> >

>

> > >                 {

>

> >

>

> > >

>

> >

>

> > >                   String u = rs.getString(1);

>

> >

>

> > >

>

> >

>

> > >                   String p = rs.getString(2);

>

> >

>

> > >

>

> >

>

> > >                   if(usn.equals(u) && pass.equals(p))

>

> >

>

> > >

>

> >

>

> > >                   {

>

> >

>

> > >

>

> >

>

> > >                      out.println("login successfull");

>

> >

>

> > >

>

> >

>

> > >                          }

>

> >

>

> > >

>

> >

>

> > >                   else

>

> >

>

> > >

>

> >

>

> > >           {

>

> >

>

> > >

>

> >

>

> > >              out.println("login failed");

>

> >

>

> > >

>

> >

>

> > >             }

>

> >

>

> > >

>

> >

>

> > >           }

>

> >

>

> > >

>

> >

>

> > >        }

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >                catch(Exception e)

>

> >

>

> > >

>

> >

>

> > >                {

>

> >

>

> > >

>

> >

>

> > >                   out.println("Error"+e);

>

> >

>

> > >

>

> >

>

> > >                   }

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >  %>

>

> >

>

> > >

>

> >

>

> > >  </form>

>

> >

>

> > >

>

> >

>

> > >  </body>

>

> >

>

> > >

>

> >

>

> > >  </html>

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > > ---------------------------------------------------------------------

>

> >

>

> > >

>

> >

>

> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org

>

> >

>

> > >

>

> >

>

> > > For additional commands, e-mail: users-help@tomcat.apache.org

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> > >

>

> >

>

> >

>

> >

>

> >

>

>

>

>


 

Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
Thank you very much for your help! When I did with mysql, the corresponding
jdbc driver is stored in /webapps/ROOT/lib directory in tomcat.

On Fri, Apr 15, 2011 at 11:56 PM, Troy <tr...@aol.com> wrote:

> I wrote a quick little jsp to access one of my db (a mysql)
>
>
> <%@page contentType="text/html" pageEncoding="UTF-8"%>
> <%@page import="java.sql.*" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>   "http://www.w3.org/TR/html4/loose.dtd">
>
> <html>
>    <head>
>        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>        <title>Test Connection</title>
>    </head>
>    <body>
>
>        <%
>        String name = "";
>        Class.forName("com.mysql.jdbc.Driver");
>        Connection conn =
> DriverManager.getConnection("jdbc:mysql://localhost/dbName", "XXXX",
> "XXXXXX");
>        Statement stmt = conn.createStatement();
>        String query = "select * from friends where id='1'";
>        ResultSet rs = stmt.executeQuery(query);
>        while(rs.next()){
>         name = rs.getString(3);
>        }
>
> %>
>
> <%= name %>
>
>    </body>
> </html>
>
> Worked like expected.  I know this is not a java thread . . . but still
> trying to help since it is a time sensitive matter.
> Silly question, but are your jdbc drivers added to your library for the web
> app?  I make this mistake ALL the time.
>
> Troy
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: RAHUL RAJ <om...@gmail.com>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Fri, Apr 15, 2011 1:59 pm
> Subject: Re: Working of Tomcat with MS Access
>
>
> ya...I did the same thing  you told in mysql...but communications Exception
>
> occured..
>
> This is like a small assignment that has to be submitted urgently..so I
> have
>
> to run away from the error! and tried with MS ACCESS.
>
> The jdbc program for access works perfect alone..
>
>
>
> On Fri, Apr 15, 2011 at 11:19 PM, Troy <tr...@aol.com> wrote:
>
>
>
> > Raj,
>
> >
>
> > I think everyone is saying to take a look at this syntax:
>
> >
>
> >
>
> > >String url = "jdbc:odbc:rahul";
>
> > >                Connection con = DriverManager.getConnection(url, "",
> "");
>
> >
>
> >
>
> > I know that when I make this type of simple jdbc connection in mysql the
>
> > syntax is:
>
> >
>
> > String url = "jdbc:mysql://localhost/dbName";
>
> > Connection conn = DriverManager.getConnection(url, "", "");
>
> >
>
> > Troy
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > -----Original Message-----
>
> > From: RAHUL RAJ <om...@gmail.com>
>
> > To: Tomcat Users List <us...@tomcat.apache.org>
>
> > Sent: Fri, Apr 15, 2011 1:31 pm
>
> > Subject: Re: Working of Tomcat with MS Access
>
> >
>
> >
>
> > I got communications exception when I did this with mysql...and no one
>
> > knows
>
> >
>
> > the reason perfectly...no response from mysql forum too...
>
> >
>
> >
>
> >
>
> > On Fri, Apr 15, 2011 at 9:08 PM, Troy <tr...@aol.com> wrote:
>
> >
>
> >
>
> >
>
> > > Raj;
>
> >
>
> > >
>
> >
>
> > > To all reading this response, this is my first response on this list so
>
> > if
>
> >
>
> > > I get it a little wrong have patience.
>
> >
>
> > >
>
> >
>
> > > You may want to look at the light weight RDBMS mysql.  It is free,
> easily
>
> >
>
> > > installed and can be utilized with the companion Workbench to make
>
> > dealing
>
> >
>
> > > with the db very easy, a lot like the access interface.  You will have
>
> > good
>
> >
>
> > > driver support from the java end as well and a lot of documentation and
>
> >
>
> > > tutorials to get you connected in your web app to your persistence
> layer.
>
> >
>
> > >
>
> >
>
> > > mysql.com
>
> >
>
> > >
>
> >
>
> > > Just my two cents and an attempt to give back a little to the
> community.
>
> >
>
> > >
>
> >
>
> > > Troy
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > -----Original Message-----
>
> >
>
> > > From: RAHUL RAJ <om...@gmail.com>
>
> >
>
> > > To: users <us...@tomcat.apache.org>
>
> >
>
> > > Sent: Fri, Apr 15, 2011 6:05 am
>
> >
>
> > > Subject: Working of Tomcat with MS Access
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Hello,
>
> >
>
> > >
>
> >
>
> > >     I am working on  building a jsp website with MS Access as
>
> >
>
> > >
>
> >
>
> > > database. When my login page is loaded on tomcat
>
> >
>
> > >
>
> >
>
> > > (localhost:8080/login.jsp), it shows the following error:
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
>
> >
>
> > >
>
> >
>
> > > name not found and no default driver specified.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > The jdbc program alone is working perfectly, So There might not be
>
> >
>
> > >
>
> >
>
> > > problems due to  Driver, Data source name, Database Tables or any
>
> >
>
> > >
>
> >
>
> > > other software version compatibilities.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > OS: Windows Vista Home Basic
>
> >
>
> > >
>
> >
>
> > > Tomcat Version: 5.5.x
>
> >
>
> > >
>
> >
>
> > > jdk version: 1.6
>
> >
>
> > >
>
> >
>
> > > MS Access 2010
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > code is given below:
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > <%@ page language="java" import="java.sql.*" %>
>
> >
>
> > >
>
> >
>
> > >  <html>
>
> >
>
> > >
>
> >
>
> > >  <body>
>
> >
>
> > >
>
> >
>
> > >  <form method="post">
>
> >
>
> > >
>
> >
>
> > >  <p> Enter your username :  <input type="text" name="username"/> </p>
>
> >
>
> > >
>
> >
>
> > >  <p> Enter your password :  <input type="text" name="password"/> </p>
>
> >
>
> > >
>
> >
>
> > >  <input type="submit" value="Login"/>
>
> >
>
> > >
>
> >
>
> > >  <%
>
> >
>
> > >
>
> >
>
> > >    String usn = request.getParameter("username");
>
> >
>
> > >
>
> >
>
> > >        String pass = request.getParameter("password");
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >        try{
>
> >
>
> > >
>
> >
>
> > >                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>
> >
>
> > >
>
> >
>
> > >                 String url = "jdbc:odbc:rahul";
>
> >
>
> > >
>
> >
>
> > >                 Connection con = DriverManager.getConnection(url, "",
>
> > "");
>
> >
>
> > >
>
> >
>
> > >                 Statement s = con.createStatement();
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >                 ResultSet rs = s.executeQuery("select * from
> customers");
>
> >
>
> > >
>
> >
>
> > >                 while(rs.next())
>
> >
>
> > >
>
> >
>
> > >                 {
>
> >
>
> > >
>
> >
>
> > >                   String u = rs.getString(1);
>
> >
>
> > >
>
> >
>
> > >                   String p = rs.getString(2);
>
> >
>
> > >
>
> >
>
> > >                   if(usn.equals(u) && pass.equals(p))
>
> >
>
> > >
>
> >
>
> > >                   {
>
> >
>
> > >
>
> >
>
> > >                      out.println("login successfull");
>
> >
>
> > >
>
> >
>
> > >                          }
>
> >
>
> > >
>
> >
>
> > >                   else
>
> >
>
> > >
>
> >
>
> > >           {
>
> >
>
> > >
>
> >
>
> > >              out.println("login failed");
>
> >
>
> > >
>
> >
>
> > >             }
>
> >
>
> > >
>
> >
>
> > >           }
>
> >
>
> > >
>
> >
>
> > >        }
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >                catch(Exception e)
>
> >
>
> > >
>
> >
>
> > >                {
>
> >
>
> > >
>
> >
>
> > >                   out.println("Error"+e);
>
> >
>
> > >
>
> >
>
> > >                   }
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >  %>
>
> >
>
> > >
>
> >
>
> > >  </form>
>
> >
>
> > >
>
> >
>
> > >  </body>
>
> >
>
> > >
>
> >
>
> > >  </html>
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > ---------------------------------------------------------------------
>
> >
>
> > >
>
> >
>
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>
> >
>
> > >
>
> >
>
> > > For additional commands, e-mail: users-help@tomcat.apache.org
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> >
>
> >
>
> >
>
>
>
>

Re: Working of Tomcat with MS Access

Posted by Troy <tr...@aol.com>.
I wrote a quick little jsp to access one of my db (a mysql)


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Test Connection</title>
    </head>
    <body>
        
        <%
        String name = "";
        Class.forName("com.mysql.jdbc.Driver");
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/dbName", "XXXX", "XXXXXX");
        Statement stmt = conn.createStatement();
        String query = "select * from friends where id='1'";
        ResultSet rs = stmt.executeQuery(query);
        while(rs.next()){
         name = rs.getString(3);
        }

%>

<%= name %>

    </body>
</html>

Worked like expected.  I know this is not a java thread . . . but still trying to help since it is a time sensitive matter.
Silly question, but are your jdbc drivers added to your library for the web app?  I make this mistake ALL the time.

Troy

 

 


 

 

-----Original Message-----
From: RAHUL RAJ <om...@gmail.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Fri, Apr 15, 2011 1:59 pm
Subject: Re: Working of Tomcat with MS Access


ya...I did the same thing  you told in mysql...but communications Exception

occured..

This is like a small assignment that has to be submitted urgently..so I have

to run away from the error! and tried with MS ACCESS.

The jdbc program for access works perfect alone..



On Fri, Apr 15, 2011 at 11:19 PM, Troy <tr...@aol.com> wrote:



> Raj,

>

> I think everyone is saying to take a look at this syntax:

>

>

> >String url = "jdbc:odbc:rahul";

> >                Connection con = DriverManager.getConnection(url, "", "");

>

>

> I know that when I make this type of simple jdbc connection in mysql the

> syntax is:

>

> String url = "jdbc:mysql://localhost/dbName";

> Connection conn = DriverManager.getConnection(url, "", "");

>

> Troy

>

>

>

>

>

>

>

>

>

>

> -----Original Message-----

> From: RAHUL RAJ <om...@gmail.com>

> To: Tomcat Users List <us...@tomcat.apache.org>

> Sent: Fri, Apr 15, 2011 1:31 pm

> Subject: Re: Working of Tomcat with MS Access

>

>

> I got communications exception when I did this with mysql...and no one

> knows

>

> the reason perfectly...no response from mysql forum too...

>

>

>

> On Fri, Apr 15, 2011 at 9:08 PM, Troy <tr...@aol.com> wrote:

>

>

>

> > Raj;

>

> >

>

> > To all reading this response, this is my first response on this list so

> if

>

> > I get it a little wrong have patience.

>

> >

>

> > You may want to look at the light weight RDBMS mysql.  It is free, easily

>

> > installed and can be utilized with the companion Workbench to make

> dealing

>

> > with the db very easy, a lot like the access interface.  You will have

> good

>

> > driver support from the java end as well and a lot of documentation and

>

> > tutorials to get you connected in your web app to your persistence layer.

>

> >

>

> > mysql.com

>

> >

>

> > Just my two cents and an attempt to give back a little to the community.

>

> >

>

> > Troy

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

> > -----Original Message-----

>

> > From: RAHUL RAJ <om...@gmail.com>

>

> > To: users <us...@tomcat.apache.org>

>

> > Sent: Fri, Apr 15, 2011 6:05 am

>

> > Subject: Working of Tomcat with MS Access

>

> >

>

> >

>

> > Hello,

>

> >

>

> >     I am working on  building a jsp website with MS Access as

>

> >

>

> > database. When my login page is loaded on tomcat

>

> >

>

> > (localhost:8080/login.jsp), it shows the following error:

>

> >

>

> >

>

> >

>

> > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source

>

> >

>

> > name not found and no default driver specified.

>

> >

>

> >

>

> >

>

> > The jdbc program alone is working perfectly, So There might not be

>

> >

>

> > problems due to  Driver, Data source name, Database Tables or any

>

> >

>

> > other software version compatibilities.

>

> >

>

> >

>

> >

>

> > OS: Windows Vista Home Basic

>

> >

>

> > Tomcat Version: 5.5.x

>

> >

>

> > jdk version: 1.6

>

> >

>

> > MS Access 2010

>

> >

>

> >

>

> >

>

> >

>

> >

>

> > code is given below:

>

> >

>

> >

>

> >

>

> > <%@ page language="java" import="java.sql.*" %>

>

> >

>

> >  <html>

>

> >

>

> >  <body>

>

> >

>

> >  <form method="post">

>

> >

>

> >  <p> Enter your username :  <input type="text" name="username"/> </p>

>

> >

>

> >  <p> Enter your password :  <input type="text" name="password"/> </p>

>

> >

>

> >  <input type="submit" value="Login"/>

>

> >

>

> >  <%

>

> >

>

> >    String usn = request.getParameter("username");

>

> >

>

> >        String pass = request.getParameter("password");

>

> >

>

> >

>

> >

>

> >        try{

>

> >

>

> >                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

>

> >

>

> >                 String url = "jdbc:odbc:rahul";

>

> >

>

> >                 Connection con = DriverManager.getConnection(url, "",

> "");

>

> >

>

> >                 Statement s = con.createStatement();

>

> >

>

> >

>

> >

>

> >                 ResultSet rs = s.executeQuery("select * from customers");

>

> >

>

> >                 while(rs.next())

>

> >

>

> >                 {

>

> >

>

> >                   String u = rs.getString(1);

>

> >

>

> >                   String p = rs.getString(2);

>

> >

>

> >                   if(usn.equals(u) && pass.equals(p))

>

> >

>

> >                   {

>

> >

>

> >                      out.println("login successfull");

>

> >

>

> >                          }

>

> >

>

> >                   else

>

> >

>

> >           {

>

> >

>

> >              out.println("login failed");

>

> >

>

> >             }

>

> >

>

> >           }

>

> >

>

> >        }

>

> >

>

> >

>

> >

>

> >                catch(Exception e)

>

> >

>

> >                {

>

> >

>

> >                   out.println("Error"+e);

>

> >

>

> >                   }

>

> >

>

> >

>

> >

>

> >  %>

>

> >

>

> >  </form>

>

> >

>

> >  </body>

>

> >

>

> >  </html>

>

> >

>

> >

>

> >

>

> > ---------------------------------------------------------------------

>

> >

>

> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org

>

> >

>

> > For additional commands, e-mail: users-help@tomcat.apache.org

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

>

>

>


 

Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
Yes....

On Sat, Apr 16, 2011 at 8:44 PM, Pid <pi...@pidster.com> wrote:

> On 4/15/11 6:58 PM, RAHUL RAJ wrote:
> > This is like a small assignment that has to be submitted urgently
>
> Is this student coursework?
>
>
> p
>
>

Re: Working of Tomcat with MS Access

Posted by Pid <pi...@pidster.com>.
On 4/15/11 6:58 PM, RAHUL RAJ wrote:
> This is like a small assignment that has to be submitted urgently

Is this student coursework?


p


Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
ya...I did the same thing  you told in mysql...but communications Exception
occured..
This is like a small assignment that has to be submitted urgently..so I have
to run away from the error! and tried with MS ACCESS.
The jdbc program for access works perfect alone..

On Fri, Apr 15, 2011 at 11:19 PM, Troy <tr...@aol.com> wrote:

> Raj,
>
> I think everyone is saying to take a look at this syntax:
>
>
> >String url = "jdbc:odbc:rahul";
> >                Connection con = DriverManager.getConnection(url, "", "");
>
>
> I know that when I make this type of simple jdbc connection in mysql the
> syntax is:
>
> String url = "jdbc:mysql://localhost/dbName";
> Connection conn = DriverManager.getConnection(url, "", "");
>
> Troy
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: RAHUL RAJ <om...@gmail.com>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Fri, Apr 15, 2011 1:31 pm
> Subject: Re: Working of Tomcat with MS Access
>
>
> I got communications exception when I did this with mysql...and no one
> knows
>
> the reason perfectly...no response from mysql forum too...
>
>
>
> On Fri, Apr 15, 2011 at 9:08 PM, Troy <tr...@aol.com> wrote:
>
>
>
> > Raj;
>
> >
>
> > To all reading this response, this is my first response on this list so
> if
>
> > I get it a little wrong have patience.
>
> >
>
> > You may want to look at the light weight RDBMS mysql.  It is free, easily
>
> > installed and can be utilized with the companion Workbench to make
> dealing
>
> > with the db very easy, a lot like the access interface.  You will have
> good
>
> > driver support from the java end as well and a lot of documentation and
>
> > tutorials to get you connected in your web app to your persistence layer.
>
> >
>
> > mysql.com
>
> >
>
> > Just my two cents and an attempt to give back a little to the community.
>
> >
>
> > Troy
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > -----Original Message-----
>
> > From: RAHUL RAJ <om...@gmail.com>
>
> > To: users <us...@tomcat.apache.org>
>
> > Sent: Fri, Apr 15, 2011 6:05 am
>
> > Subject: Working of Tomcat with MS Access
>
> >
>
> >
>
> > Hello,
>
> >
>
> >     I am working on  building a jsp website with MS Access as
>
> >
>
> > database. When my login page is loaded on tomcat
>
> >
>
> > (localhost:8080/login.jsp), it shows the following error:
>
> >
>
> >
>
> >
>
> > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
>
> >
>
> > name not found and no default driver specified.
>
> >
>
> >
>
> >
>
> > The jdbc program alone is working perfectly, So There might not be
>
> >
>
> > problems due to  Driver, Data source name, Database Tables or any
>
> >
>
> > other software version compatibilities.
>
> >
>
> >
>
> >
>
> > OS: Windows Vista Home Basic
>
> >
>
> > Tomcat Version: 5.5.x
>
> >
>
> > jdk version: 1.6
>
> >
>
> > MS Access 2010
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > code is given below:
>
> >
>
> >
>
> >
>
> > <%@ page language="java" import="java.sql.*" %>
>
> >
>
> >  <html>
>
> >
>
> >  <body>
>
> >
>
> >  <form method="post">
>
> >
>
> >  <p> Enter your username :  <input type="text" name="username"/> </p>
>
> >
>
> >  <p> Enter your password :  <input type="text" name="password"/> </p>
>
> >
>
> >  <input type="submit" value="Login"/>
>
> >
>
> >  <%
>
> >
>
> >    String usn = request.getParameter("username");
>
> >
>
> >        String pass = request.getParameter("password");
>
> >
>
> >
>
> >
>
> >        try{
>
> >
>
> >                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>
> >
>
> >                 String url = "jdbc:odbc:rahul";
>
> >
>
> >                 Connection con = DriverManager.getConnection(url, "",
> "");
>
> >
>
> >                 Statement s = con.createStatement();
>
> >
>
> >
>
> >
>
> >                 ResultSet rs = s.executeQuery("select * from customers");
>
> >
>
> >                 while(rs.next())
>
> >
>
> >                 {
>
> >
>
> >                   String u = rs.getString(1);
>
> >
>
> >                   String p = rs.getString(2);
>
> >
>
> >                   if(usn.equals(u) && pass.equals(p))
>
> >
>
> >                   {
>
> >
>
> >                      out.println("login successfull");
>
> >
>
> >                          }
>
> >
>
> >                   else
>
> >
>
> >           {
>
> >
>
> >              out.println("login failed");
>
> >
>
> >             }
>
> >
>
> >           }
>
> >
>
> >        }
>
> >
>
> >
>
> >
>
> >                catch(Exception e)
>
> >
>
> >                {
>
> >
>
> >                   out.println("Error"+e);
>
> >
>
> >                   }
>
> >
>
> >
>
> >
>
> >  %>
>
> >
>
> >  </form>
>
> >
>
> >  </body>
>
> >
>
> >  </html>
>
> >
>
> >
>
> >
>
> > ---------------------------------------------------------------------
>
> >
>
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>
> >
>
> > For additional commands, e-mail: users-help@tomcat.apache.org
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
>
>
>

Re: Working of Tomcat with MS Access

Posted by Troy <tr...@aol.com>.
Raj,

I think everyone is saying to take a look at this syntax:


>String url = "jdbc:odbc:rahul";
>		 Connection con = DriverManager.getConnection(url, "", "");


I know that when I make this type of simple jdbc connection in mysql the syntax is:

String url = "jdbc:mysql://localhost/dbName";
Connection conn = DriverManager.getConnection(url, "", "");

Troy

 

 


 

 

-----Original Message-----
From: RAHUL RAJ <om...@gmail.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Fri, Apr 15, 2011 1:31 pm
Subject: Re: Working of Tomcat with MS Access


I got communications exception when I did this with mysql...and no one knows

the reason perfectly...no response from mysql forum too...



On Fri, Apr 15, 2011 at 9:08 PM, Troy <tr...@aol.com> wrote:



> Raj;

>

> To all reading this response, this is my first response on this list so if

> I get it a little wrong have patience.

>

> You may want to look at the light weight RDBMS mysql.  It is free, easily

> installed and can be utilized with the companion Workbench to make dealing

> with the db very easy, a lot like the access interface.  You will have good

> driver support from the java end as well and a lot of documentation and

> tutorials to get you connected in your web app to your persistence layer.

>

> mysql.com

>

> Just my two cents and an attempt to give back a little to the community.

>

> Troy

>

>

>

>

>

>

>

>

>

>

> -----Original Message-----

> From: RAHUL RAJ <om...@gmail.com>

> To: users <us...@tomcat.apache.org>

> Sent: Fri, Apr 15, 2011 6:05 am

> Subject: Working of Tomcat with MS Access

>

>

> Hello,

>

>     I am working on  building a jsp website with MS Access as

>

> database. When my login page is loaded on tomcat

>

> (localhost:8080/login.jsp), it shows the following error:

>

>

>

> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source

>

> name not found and no default driver specified.

>

>

>

> The jdbc program alone is working perfectly, So There might not be

>

> problems due to  Driver, Data source name, Database Tables or any

>

> other software version compatibilities.

>

>

>

> OS: Windows Vista Home Basic

>

> Tomcat Version: 5.5.x

>

> jdk version: 1.6

>

> MS Access 2010

>

>

>

>

>

> code is given below:

>

>

>

> <%@ page language="java" import="java.sql.*" %>

>

>  <html>

>

>  <body>

>

>  <form method="post">

>

>  <p> Enter your username :  <input type="text" name="username"/> </p>

>

>  <p> Enter your password :  <input type="text" name="password"/> </p>

>

>  <input type="submit" value="Login"/>

>

>  <%

>

>    String usn = request.getParameter("username");

>

>        String pass = request.getParameter("password");

>

>

>

>        try{

>

>                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

>

>                 String url = "jdbc:odbc:rahul";

>

>                 Connection con = DriverManager.getConnection(url, "", "");

>

>                 Statement s = con.createStatement();

>

>

>

>                 ResultSet rs = s.executeQuery("select * from customers");

>

>                 while(rs.next())

>

>                 {

>

>                   String u = rs.getString(1);

>

>                   String p = rs.getString(2);

>

>                   if(usn.equals(u) && pass.equals(p))

>

>                   {

>

>                      out.println("login successfull");

>

>                          }

>

>                   else

>

>           {

>

>              out.println("login failed");

>

>             }

>

>           }

>

>        }

>

>

>

>                catch(Exception e)

>

>                {

>

>                   out.println("Error"+e);

>

>                   }

>

>

>

>  %>

>

>  </form>

>

>  </body>

>

>  </html>

>

>

>

> ---------------------------------------------------------------------

>

> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org

>

> For additional commands, e-mail: users-help@tomcat.apache.org

>

>

>

>

>

>


 

Re: Working of Tomcat with MS Access

Posted by RAHUL RAJ <om...@gmail.com>.
I got communications exception when I did this with mysql...and no one knows
the reason perfectly...no response from mysql forum too...

On Fri, Apr 15, 2011 at 9:08 PM, Troy <tr...@aol.com> wrote:

> Raj;
>
> To all reading this response, this is my first response on this list so if
> I get it a little wrong have patience.
>
> You may want to look at the light weight RDBMS mysql.  It is free, easily
> installed and can be utilized with the companion Workbench to make dealing
> with the db very easy, a lot like the access interface.  You will have good
> driver support from the java end as well and a lot of documentation and
> tutorials to get you connected in your web app to your persistence layer.
>
> mysql.com
>
> Just my two cents and an attempt to give back a little to the community.
>
> Troy
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: RAHUL RAJ <om...@gmail.com>
> To: users <us...@tomcat.apache.org>
> Sent: Fri, Apr 15, 2011 6:05 am
> Subject: Working of Tomcat with MS Access
>
>
> Hello,
>
>     I am working on  building a jsp website with MS Access as
>
> database. When my login page is loaded on tomcat
>
> (localhost:8080/login.jsp), it shows the following error:
>
>
>
> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source
>
> name not found and no default driver specified.
>
>
>
> The jdbc program alone is working perfectly, So There might not be
>
> problems due to  Driver, Data source name, Database Tables or any
>
> other software version compatibilities.
>
>
>
> OS: Windows Vista Home Basic
>
> Tomcat Version: 5.5.x
>
> jdk version: 1.6
>
> MS Access 2010
>
>
>
>
>
> code is given below:
>
>
>
> <%@ page language="java" import="java.sql.*" %>
>
>  <html>
>
>  <body>
>
>  <form method="post">
>
>  <p> Enter your username :  <input type="text" name="username"/> </p>
>
>  <p> Enter your password :  <input type="text" name="password"/> </p>
>
>  <input type="submit" value="Login"/>
>
>  <%
>
>    String usn = request.getParameter("username");
>
>        String pass = request.getParameter("password");
>
>
>
>        try{
>
>                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>
>                 String url = "jdbc:odbc:rahul";
>
>                 Connection con = DriverManager.getConnection(url, "", "");
>
>                 Statement s = con.createStatement();
>
>
>
>                 ResultSet rs = s.executeQuery("select * from customers");
>
>                 while(rs.next())
>
>                 {
>
>                   String u = rs.getString(1);
>
>                   String p = rs.getString(2);
>
>                   if(usn.equals(u) && pass.equals(p))
>
>                   {
>
>                      out.println("login successfull");
>
>                          }
>
>                   else
>
>           {
>
>              out.println("login failed");
>
>             }
>
>           }
>
>        }
>
>
>
>                catch(Exception e)
>
>                {
>
>                   out.println("Error"+e);
>
>                   }
>
>
>
>  %>
>
>  </form>
>
>  </body>
>
>  </html>
>
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>
>

Re: Working of Tomcat with MS Access

Posted by Troy <tr...@aol.com>.
Raj;

To all reading this response, this is my first response on this list so if I get it a little wrong have patience.

You may want to look at the light weight RDBMS mysql.  It is free, easily installed and can be utilized with the companion Workbench to make dealing with the db very easy, a lot like the access interface.  You will have good driver support from the java end as well and a lot of documentation and tutorials to get you connected in your web app to your persistence layer.

mysql.com

Just my two cents and an attempt to give back a little to the community.

Troy

 

 


 

 

-----Original Message-----
From: RAHUL RAJ <om...@gmail.com>
To: users <us...@tomcat.apache.org>
Sent: Fri, Apr 15, 2011 6:05 am
Subject: Working of Tomcat with MS Access


Hello,

     I am working on  building a jsp website with MS Access as

database. When my login page is loaded on tomcat

(localhost:8080/login.jsp), it shows the following error:



java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source

name not found and no default driver specified.



The jdbc program alone is working perfectly, So There might not be

problems due to  Driver, Data source name, Database Tables or any

other software version compatibilities.



OS: Windows Vista Home Basic

Tomcat Version: 5.5.x

jdk version: 1.6

MS Access 2010





code is given below:



<%@ page language="java" import="java.sql.*" %>

 <html>

 <body>

 <form method="post">

 <p> Enter your username :  <input type="text" name="username"/> </p>

 <p> Enter your password :  <input type="text" name="password"/> </p>

 <input type="submit" value="Login"/>

 <%

    String usn = request.getParameter("username");

	String pass = request.getParameter("password");



	try{

	         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

		 String url = "jdbc:odbc:rahul";

		 Connection con = DriverManager.getConnection(url, "", "");

		 Statement s = con.createStatement();

		

		 ResultSet rs = s.executeQuery("select * from customers");

		 while(rs.next())

		 {

		   String u = rs.getString(1);

		   String p = rs.getString(2);

		   if(usn.equals(u) && pass.equals(p))

		   {

		      out.println("login successfull");

			  }

		   else

           {

              out.println("login failed");

             }

           }

        }

		

		catch(Exception e)

		{

		   out.println("Error"+e);

		   }

 			

 %>

 </form>

 </body>

 </html>



---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org

For additional commands, e-mail: users-help@tomcat.apache.org