| Author |
Unable to get connection, DataSource invalid
|
Arvind Mahendra
Ranch Hand
Joined: Jul 14, 2007
Posts: 1162
|
|
My database is called 'example' this is what my web.xml looks like <context-param> <param-name>javax.servlet.jsp.jstl.sql.dataSource</param-name> <param-value>jdbc:mysql://example,com.mysql.jdbc.Driver,sa,.</param-value> </context-param> In my JSP this is the code causing the exception <sql:query var="empDbInfo"> SELECT * FROM Employee WHERE UserName = ? <sql:param value="${param.userName}" /> </sql:query> This is the exception: Any ideas? [ December 01, 2007: Message edited by: Chunnard Singh II ]
|
I want to be like marc
|
 |
I Wayan Saryada
Ranch Hand
Joined: Feb 05, 2004
Posts: 83
|
|
|
I think your connection URL should be like: jdbc:mysql://localhost/example. In your configuration you forget to mention the server location where your example database is.
|
Website: Learn Java by Examples
|
 |
Arvind Mahendra
Ranch Hand
Joined: Jul 14, 2007
Posts: 1162
|
|
Originally posted by I Wayan Saryada: I think your connection URL should be like: jdbc:mysql://localhost/example. In your configuration you forget to mention the server location where your example database is.
tried this too but no luck!
|
 |
I Wayan Saryada
Ranch Hand
Joined: Feb 05, 2004
Posts: 83
|
|
|
Did the error message the same as before?
|
 |
Arvind Mahendra
Ranch Hand
Joined: Jul 14, 2007
Posts: 1162
|
|
Originally posted by I Wayan Saryada: Did the error message the same as before?
Hey man you rock!. I was checking thru the error messages when I realized I hadnt started the Mysql server. It works now. The problem was like you said I had omitted the 'localhost'. Thanks.
|
 |
 |
|
|
subject: Unable to get connection, DataSource invalid
|
|
|