Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to get connection, DataSource invalid

 
Arvind Mahendra
Ranch Hand
Posts: 1162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Wayan Saryada
Ranch Hand
Posts: 105
IntelliJ IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Arvind Mahendra
Ranch Hand
Posts: 1162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Wayan Saryada
Ranch Hand
Posts: 105
IntelliJ IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did the error message the same as before?
 
Arvind Mahendra
Ranch Hand
Posts: 1162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic