tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Haynes <david.hayn...@sympatico.ca>
Subject Re: switching
Date Sat, 03 Sep 2005 15:43:09 GMT
Is there any chance getServerName is not returning server.com or localhost?
If so, sDriver would not be defined...

-david-

JhnVend@netscape.net wrote:

>Could someone point out what's wrong with this setup? 
>
>I have a laptop, sometimes going offline and don't want to
>change strings each time I'm online or offline. (And don't want to run any
>db server on the laptop if I can avoid it.)
>
>Error is here:
>
>org.apache.jasper.JasperException: Unable to compile class for JSP
>
>An error occurred at line: 1 in the jsp file: conn_products.jsp
>Generated servlet error:
>sDriver cannot be resolved
>
>
>
>
>In setup.jsp,
>
><%
>if(request.getServerName().equals("server.com")) {
>  String sDriver = "com.mysql.jdbc.Driver";
>  String sUser = "user";
>  String sPass = "password";
>  String sDSN = "jdbc:mysql://localhost:3306/products";
>} else if (request.getServerName().equals("localhost")) {
>  String sDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
>  String sUser = "";
>  String sPass = "";
>  String sDSN = "jdbc:odbc:products";
>}
>%>
>
>In conn_products.jsp,
>
><%
>        String MM_products_DRIVER = sDriver ;
>        String MM_products_USERNAME = sUser ;
>        String MM_products_PASSWORD = sPass ;
>        String MM_products_STRING = sDSN ;
>%>
>  
>And in list.jsp,
>  
><%include file="setup.jsp"%>
><%include file="conn_products.jsp"%>
>  
>Jhn
>
>__________________________________________________________________
>Switch to Netscape Internet Service.
>As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register
>
>Netscape. Just the Net You Need.
>
>New! Netscape Toolbar for Internet Explorer
>Search from anywhere on the Web and block those annoying pop-ups.
>Download now at http://channels.netscape.com/ns/search/install.jsp
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>  
>



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


Mime
View raw message