I've made progress on this. No offense, but I can see several areas
where the documentation and error-handling could be better. The links
to the samples on the web sites return 404s, but I was able to find a
reasonable example by finding a commit to one of the test scripts in the
mailing list archives. From that, I could see that several wild guesses
I made on what parameters are required were wrong, and some of those
guesses returned exceptions without any useful diagnostics.
I thought I had to reference a specific datasource in the "sql:query"
tag, and I couldn't find any variation of the "dataSource" value that
would work. From the example, I realized that you can leave that out
entirely, and just let it use the default datasource, which is
apparently whatever datasource you define in the "setDataSource" tag.
I also discovered that a "sql:query" without a "var" attribute throws an
NPE. Now I have to figure out what I can do with the var I've set.
At least I'm not throwing exceptions anymore.
> -----Original Message-----
> From: Karr, David
> Sent: Thursday, July 20, 2006 3:37 PM
> To: Jakarta Commons Users List
> Subject: [jelly] simple script fails with: No suitable driver
>
> I have an Ant script that uses the "sql" task, and I can
> connect to my db and run a query.
>
> I also have a jelly script that tries to do the same thing.
> I'm using "sql:setDataSource" and "sql:query". I'm using the
> same properties file for both the Ant and Jelly tests. The
> Jelly script fails with:
>
> <sql:query> Unable to get connection, DataSource invalid:
> "No suitable driver"
>
> My Jelly script is just this:
>
> --------------------
> <document xmlns:util="jelly:util" xmlns:sql="jelly:sql"
> xmlns:log="jelly:log">
> <util:properties file="dbtest.properties"/> <log:info>
> user="${dbuser}"
> password="${dbpwd}"
> url="jdbc:oracle:thin:@${dbhost}:${dbport}:${dbname}"
> </log:info>
> <sql:setDataSource dataSource="ds"
> driver="oracle.jdbc.OracleDriver"
> user="${dbuser}" password="${dbpwd}"
>
> url="jdbc:oracle:thin:@${dbhost}:${dbport}:${dbname}" />
>
> <sql:query dataSource="ds" sql="SELECT TABLE_NAME FROM
> USER_TAB_COLUMNS" /> </document>
> --------------------
>
> I put the "ojdbc14.jar" in my classpath by setting JELLY_OPTS
> to set a property pointing to the root of the Oracle drivers
> (inside the WebLogic distribution), and I set forehead.conf
> to reference that variable, and add
> "${wlsextjdbc}/oracle/920/ojdbc14.jar" to the "[root.jelly]"
> section. I'm not certain whether this is the correct way to
> add this to the classpath.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]