I compiled with JDK 1.5. I add a resource declaration in Tomcat 5.5. Here is
the content of conf/context.xml
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat
restarts -->
<!--
<Manager pathname="" />
-->
</Context>
<Context path="/DBMobile" docBase="DBMobile"
debug="5" reloadable="true" crossContext="true">
<Resource name="jdbc/MobileDB" auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="root"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mobile?autoReconnect=true"/>
</Context>
I create a document with some code:
#set ($mydb=$xwiki.sql.getDabase("MobileDB"))
<table>
#foreach($row in $mydb.executeQuery("select id, name from mobile"))
<tr>
<td>$row.getString("id") </td>
<td>$row.getString("name") </td>
</tr>
#end
</table>
$mydb seems to have null value, no table return. I followed your
installation guide, I don't know if I miss something? Do I need some
configuration in web.xml?