You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dolo <do...@yahoo.es> on 2003/04/04 11:13:56 UTC

[users@httpd] Database problem

Hi!
I have Apache 2.0 and Tomcat 4.1.24 installed on Windows 2000 Server. And I
have a Web Application running on Tomcat (HTML and JSP files are placed in
Tomcat respective folder). JSP files have to retrieve data from a MS Access
2000 database (it's on a different machine), but an error message is shown
when trying to get the data:

"[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path.
Make sure that the path name is spelled correctly and that you are connected
to the server on which the file resides."

This application works perfectly when running on IIS & Tomcat, so I think it
might be an Apache problem. Everything remains the same, except that I moved
from IIS to Apache. I´m using the same System DSN to access the database.
Any idea of why database can't be reached?

Thanks,
Dolores


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Database problem

Posted by Huang Xingang <mp...@nus.edu.sg>.
Congratulation!

*********** REPLY SEPARATOR  ***********

On 2003-4-4 at 17:53 Dolo wrote:

>I finally found the solution! The problem was about privileges not given
>to
>Apache (I have it as a Windows Service). I was trying to access network
>resources (database) without the respective privilege. If someone is
>interested, here is the documentation:
>http://httpd.apache.org/docs-2.0/platform/windows.html#winsvc
>
>
>
>-----Original Message-----
>From: Dolo [mailto:dologij@yahoo.es]
>Sent: Friday, 04 April, 2003 15:14
>To: users@httpd.apache.org
>Subject: RE: [users@httpd] Database problem
>
>
>No problem in showing you the JSP code, but it works with IIS & Tomcat
>(that´s why I think the problem is with Apache):
>
><%@ page info="User Login"
>	errorPage ="errorLogin.jsp"
>%>
><%! String urldb = "jdbc:odbc:DSNUserData";
>    /*    More code here    */
>%>
><html>
><head>
><TITLE>User Login</TITLE>
><jsp:useBean id="BeanDB" class="sun.jdbc.rowset.CachedRowSet"
>scope="session">
><%
>  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>  // initialize our CachedRowSet bean
>  BeanDB.setUsername("");
>  BeanDB.setPassword("");
>  BeanDB.setUrl(urldb);
>  // some drivers require this
>  //  BeanDB.setTableName("user");
>%>
></jsp:useBean>
>
></head>
>
><body>
><%
>    userID = request.getParameter("userID");
>    psw = request.getParameter("psw");
>    if ( (userID != null) && (psw != null) && (!userID.equals("")) &&
>(!psw.equals("")) ) {
>
>	String strSql = "SELECT NAME, PASSWORD FROM USER WHERE USERCODE LIKE '"
+
>userID +"'";
>        BeanDB.setCommand(strSql);
>        BeanDB.execute();
>        BeanDB.beforeFirst();
>        if(BeanDB.next()){
>        	userName = BeanDB.getString("NAME");
>        	dbPsw = BeanDB.getString("PASSWORD");
>        }else{
>        	throw new Exception("Invalid User");
>        }
>
>    /*    More code here    */
>
>%>
></body>
></html>
>
>
>
>
>-----Original Message-----
>From: Huang Xingang [mailto:mpehxg@nus.edu.sg]
>Sent: Friday, 04 April, 2003 13:56
>To: users@httpd.apache.org
>Subject: Re: [users@httpd] Database problem
>
>
>It's nothing to do with your Apache.
>Can I see your jsp code to access the database?
>
>*********** REPLY SEPARATOR  ***********
>
>On 2003-4-4 at 11:13 Dolo wrote:
>
>>Hi!
>>I have Apache 2.0 and Tomcat 4.1.24 installed on Windows 2000 Server. And
>I
>>have a Web Application running on Tomcat (HTML and JSP files are placed
in
>>Tomcat respective folder). JSP files have to retrieve data from a MS
>Access
>>2000 database (it's on a different machine), but an error message is
shown
>>when trying to get the data:
>>
>>"[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid
>path.
>>Make sure that the path name is spelled correctly and that you are
>>connected
>>to the server on which the file resides."
>>
>>This application works perfectly when running on IIS & Tomcat, so I think
>>it
>>might be an Apache problem. Everything remains the same, except that I
>>moved
>>from IIS to Apache. I´m using the same System DSN to access the
>database.
>>Any idea of why database can't be reached?
>>
>>Thanks,
>>Dolores
>>
>>
>>---------------------------------------------------------------------
>>The official User-To-User support forum of the Apache HTTP Server
Project.
>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>******************************************
>Dr. Huang Xingang
>******************************************
>Laboratory for Concurrent Engineering & Logistics
>Department of Mechanical Engineering
>National University of Singapore
>10 Kent Ridge Crescent
>Singapore 119260
>******************************************
>Tel: (65) 6874-4857
>Fax: (65) 6779-5922
>Email: mpehxg@nus.edu.sg
>******************************************
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


******************************************
Dr. Huang Xingang
******************************************
Laboratory for Concurrent Engineering & Logistics
Department of Mechanical Engineering
National University of Singapore
10 Kent Ridge Crescent
Singapore 119260
******************************************
Tel: (65) 6874-4857
Fax: (65) 6779-5922
Email: mpehxg@nus.edu.sg
******************************************


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Database problem

Posted by Dolo <do...@yahoo.es>.
I finally found the solution! The problem was about privileges not given to
Apache (I have it as a Windows Service). I was trying to access network
resources (database) without the respective privilege. If someone is
interested, here is the documentation:
http://httpd.apache.org/docs-2.0/platform/windows.html#winsvc



-----Original Message-----
From: Dolo [mailto:dologij@yahoo.es]
Sent: Friday, 04 April, 2003 15:14
To: users@httpd.apache.org
Subject: RE: [users@httpd] Database problem


No problem in showing you the JSP code, but it works with IIS & Tomcat
(that´s why I think the problem is with Apache):

<%@ page info="User Login"
	errorPage ="errorLogin.jsp"
%>
<%! String urldb = "jdbc:odbc:DSNUserData";
    /*    More code here    */
%>
<html>
<head>
<TITLE>User Login</TITLE>
<jsp:useBean id="BeanDB" class="sun.jdbc.rowset.CachedRowSet"
scope="session">
<%
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  // initialize our CachedRowSet bean
  BeanDB.setUsername("");
  BeanDB.setPassword("");
  BeanDB.setUrl(urldb);
  // some drivers require this
  //  BeanDB.setTableName("user");
%>
</jsp:useBean>

</head>

<body>
<%
    userID = request.getParameter("userID");
    psw = request.getParameter("psw");
    if ( (userID != null) && (psw != null) && (!userID.equals("")) &&
(!psw.equals("")) ) {

	String strSql = "SELECT NAME, PASSWORD FROM USER WHERE USERCODE LIKE '" +
userID +"'";
        BeanDB.setCommand(strSql);
        BeanDB.execute();
        BeanDB.beforeFirst();
        if(BeanDB.next()){
        	userName = BeanDB.getString("NAME");
        	dbPsw = BeanDB.getString("PASSWORD");
        }else{
        	throw new Exception("Invalid User");
        }

    /*    More code here    */

%>
</body>
</html>




-----Original Message-----
From: Huang Xingang [mailto:mpehxg@nus.edu.sg]
Sent: Friday, 04 April, 2003 13:56
To: users@httpd.apache.org
Subject: Re: [users@httpd] Database problem


It's nothing to do with your Apache.
Can I see your jsp code to access the database?

*********** REPLY SEPARATOR  ***********

On 2003-4-4 at 11:13 Dolo wrote:

>Hi!
>I have Apache 2.0 and Tomcat 4.1.24 installed on Windows 2000 Server. And
I
>have a Web Application running on Tomcat (HTML and JSP files are placed in
>Tomcat respective folder). JSP files have to retrieve data from a MS
Access
>2000 database (it's on a different machine), but an error message is shown
>when trying to get the data:
>
>"[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid
path.
>Make sure that the path name is spelled correctly and that you are
>connected
>to the server on which the file resides."
>
>This application works perfectly when running on IIS & Tomcat, so I think
>it
>might be an Apache problem. Everything remains the same, except that I
>moved
>from IIS to Apache. I´m using the same System DSN to access the
database.
>Any idea of why database can't be reached?
>
>Thanks,
>Dolores
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


******************************************
Dr. Huang Xingang
******************************************
Laboratory for Concurrent Engineering & Logistics
Department of Mechanical Engineering
National University of Singapore
10 Kent Ridge Crescent
Singapore 119260
******************************************
Tel: (65) 6874-4857
Fax: (65) 6779-5922
Email: mpehxg@nus.edu.sg
******************************************


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Database problem

Posted by Dolo <do...@yahoo.es>.
No problem in showing you the JSP code, but it works with IIS & Tomcat
(that´s why I think the problem is with Apache):

<%@ page info="User Login"
	errorPage ="errorLogin.jsp"
%>
<%! String urldb = "jdbc:odbc:DSNUserData";
    /*    More code here    */
%>
<html>
<head>
<TITLE>User Login</TITLE>
<jsp:useBean id="BeanDB" class="sun.jdbc.rowset.CachedRowSet"
scope="session">
<%
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  // initialize our CachedRowSet bean
  BeanDB.setUsername("");
  BeanDB.setPassword("");
  BeanDB.setUrl(urldb);
  // some drivers require this
  //  BeanDB.setTableName("user");
%>
</jsp:useBean>

</head>

<body>
<%
    userID = request.getParameter("userID");
    psw = request.getParameter("psw");
    if ( (userID != null) && (psw != null) && (!userID.equals("")) &&
(!psw.equals("")) ) {

	String strSql = "SELECT NAME, PASSWORD FROM USER WHERE USERCODE LIKE '" +
userID +"'";
        BeanDB.setCommand(strSql);
        BeanDB.execute();
        BeanDB.beforeFirst();
        if(BeanDB.next()){
        	userName = BeanDB.getString("NAME");
        	dbPsw = BeanDB.getString("PASSWORD");
        }else{
        	throw new Exception("Invalid User");
        }

    /*    More code here    */

%>
</body>
</html>




-----Original Message-----
From: Huang Xingang [mailto:mpehxg@nus.edu.sg]
Sent: Friday, 04 April, 2003 13:56
To: users@httpd.apache.org
Subject: Re: [users@httpd] Database problem


It's nothing to do with your Apache.
Can I see your jsp code to access the database?

*********** REPLY SEPARATOR  ***********

On 2003-4-4 at 11:13 Dolo wrote:

>Hi!
>I have Apache 2.0 and Tomcat 4.1.24 installed on Windows 2000 Server. And
I
>have a Web Application running on Tomcat (HTML and JSP files are placed in
>Tomcat respective folder). JSP files have to retrieve data from a MS
Access
>2000 database (it's on a different machine), but an error message is shown
>when trying to get the data:
>
>"[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid
path.
>Make sure that the path name is spelled correctly and that you are
>connected
>to the server on which the file resides."
>
>This application works perfectly when running on IIS & Tomcat, so I think
>it
>might be an Apache problem. Everything remains the same, except that I
>moved
>from IIS to Apache. I´m using the same System DSN to access the
database.
>Any idea of why database can't be reached?
>
>Thanks,
>Dolores
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


******************************************
Dr. Huang Xingang
******************************************
Laboratory for Concurrent Engineering & Logistics
Department of Mechanical Engineering
National University of Singapore
10 Kent Ridge Crescent
Singapore 119260
******************************************
Tel: (65) 6874-4857
Fax: (65) 6779-5922
Email: mpehxg@nus.edu.sg
******************************************


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Database problem

Posted by Huang Xingang <mp...@nus.edu.sg>.
It's nothing to do with your Apache.
Can I see your jsp code to access the database?

*********** REPLY SEPARATOR  ***********

On 2003-4-4 at 11:13 Dolo wrote:

>Hi!
>I have Apache 2.0 and Tomcat 4.1.24 installed on Windows 2000 Server. And
I
>have a Web Application running on Tomcat (HTML and JSP files are placed in
>Tomcat respective folder). JSP files have to retrieve data from a MS
Access
>2000 database (it's on a different machine), but an error message is shown
>when trying to get the data:
>
>"[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid
path.
>Make sure that the path name is spelled correctly and that you are
>connected
>to the server on which the file resides."
>
>This application works perfectly when running on IIS & Tomcat, so I think
>it
>might be an Apache problem. Everything remains the same, except that I
>moved
>from IIS to Apache. I´m using the same System DSN to access the
database.
>Any idea of why database can't be reached?
>
>Thanks,
>Dolores
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


******************************************
Dr. Huang Xingang
******************************************
Laboratory for Concurrent Engineering & Logistics
Department of Mechanical Engineering
National University of Singapore
10 Kent Ridge Crescent
Singapore 119260
******************************************
Tel: (65) 6874-4857
Fax: (65) 6779-5922
Email: mpehxg@nus.edu.sg
******************************************


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org