commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Wynter" <da...@stpenable.com>
Subject [Jelly] setDataSource error in sql tags
Date Fri, 17 Dec 2004 20:07:33 GMT
Hi,

I have the script below, it is giving this error
"file:/d:/aim_files/work/3340.xml:33:15: <sql:update> Unable to get
connection, DataSource invalid: "The url cannot be null" "

But as far as I can see I am setting the value correctly. Any hints?

<j:jelly xmlns:j="http://www.blah.com/ns/jelly"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blah.com/ns/jelly jelly.xsd"
xmlns:sql="jelly:sql">
  <j:set var="datepattern" value="MMdd"/>
  <j:set var="databaseUrl"
value="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=TestDb;SelectM
ethod=cursor"/>
  <j:set var="databaseDriver"
value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
  <j:set var="databaseUser" value="rwLoader"/>
  <j:set var="databasePassword" value="blahblah"/>
  <j:set var="prefix" value="????"/>
  <j:set var="extn" value=".I"/>

  <j:new className="java.util.Date" var="today"/>
  <j:new className="java.text.SimpleDateFormat" var="sdf"/>
  <j:new className="java.lang.StringBuffer" var="sbuf"/>

  <j:invoke method="applyPattern" on="${sdf}">
      <j:arg value="${datepattern}"/>
  </j:invoke>
  <j:invoke method="format" on="${sdf}" var="partdatestr">
      <j:arg value="${today}"/>
  </j:invoke>
  <j:invoke method="append" on="${sbuf}" var="pattern">
      <j:arg value="${prefix}"/>
  </j:invoke>
  <j:invoke method="append" on="${sbuf}" var="pattern">
      <j:arg value="${partdatestr}"/>
  </j:invoke>
  <j:invoke method="append" on="${sdf}" var="pattern">
      <j:arg value="${extn}"/>
  </j:invoke>

  <sql:setDataSource url="${databaseUrl}" driver="${databaseDriver}"
user="${databaseUser}"
    password="${databasePassword}"/>
  <sql:update>
      update rw_file set filename_pattern=? where filename = ?
      <sql:param value="${pattern}"/>
      <sql:param value="RD EQ Cross Reference Init file"/>
  </sql:update>
</j:jelly>"

Thx.

David


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


Mime
View raw message