commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David at roamware" <da...@roamware.co.uk>
Subject RE: [Jelly] setDataSource error in sql tags
Date Sat, 18 Dec 2004 16:50:40 GMT
Hi,

No takers on this so far. Tried something more direct

<sql:setDataSource
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=RWTransformer;Se
lectMethod=cursor" driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
user="rwLoader" password="password"/>

It changed the error message but no more. Error is now:

file:/d:/aim_files/work/3340.xml:35:26: <sql:setDataSource>
org/apache/commons/jelly/util/ClassLoaderUtils

Since I copied the syntax from the test example3.xml for the sql tag lib I
confess I don't know why it is not working.

David

-----Original Message-----
From: David at roamware [mailto:david@roamware.co.uk]
Sent: 17 December 2004 20:10
To: Commons-User
Subject: [Jelly] setDataSource error in sql tags


Hi,

Sorry if this double posted as I sent it from the wrong email account first
time.

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


---------------------------------------------------------------------
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