cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Ross" <ianc...@hotmail.com>
Subject problems accessing database
Date Fri, 19 Dec 2003 07:38:33 GMT
Hi
I am trying to get access to a SQLserver database. I am not sure what the 
problem is.
i have the following line in cocoon.xconf
<dburl>jdbc:microsoft:sqlserver://databaseserver:1433/Soccer Scores</dburl>
<user/>
<password/>
I also have the correct driver in the web.xml file.
com.microsoft.jdbc.sqlserver.SQLServerDriver

I am not sure if the above entry is valid as the database name has two words 
- "Soccer Scores".
I am also not aware how to run a query on the database as it is evident i 
would get a syntax error.
eg: Select * from Soccer scores.organisms;
How would i handle this case using the ESQL logicsheet??
I tried writing a sample page to get access to the database but only the 
root element of the xml is produced and closing tag is not present. The 
sample .xsp page is below.
The output produced is
<?xml version="1.0" encoding="UTF-8"?>
<user_info xmlns:mylogic="http://hostname/mylogic/1.0" 
xmlns:xsp="http://apache.org/xsp" 
xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1" 
xmlns:esql="http://apache.org/cocoon/SQL/v2">

Ive tried looking for answers in mailing lists but could not get it working.
Any help would be greatly appreciated.
Thanks in advance for your time.
Ian.


<xsp:page
               language="java"
               xmlns:xsp="http://apache.org/xsp"
               xmlns:esql="http://apache.org/cocoon/SQL/v2"
               xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<user_info>
   <esql:connection>
       <esql:pool>bigpool</esql:pool>

         <esql:execute-query>
            <esql:query>
               select *
               from results <!-- this would normally be written as Soccer 
Scores.results-->
            </esql:query>
            <esql:results>
                    <hello>HELLO WORLD</hello>
            </esql:results>

            <esql:no-results>
               <not_present>NOTHING</not_present>
            </esql:no-results>

            <esql:error-results>
		    <esql:get-message/>
		    <esql:get-stacktrace/>
		    <esql:to-string/>
            </esql:error-results>

         </esql:execute-query>
   </esql:connection>
</user_info>

</xsp:page>

_________________________________________________________________
Get less junk mail with ninemsn Premium. Click here  
http://ninemsn.com.au/premium/landing.asp


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message