struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terje Hopsø <tehos...@online.no>
Subject RE: Accessing database in java and jsp?
Date Tue, 08 Jul 2003 21:25:27 GMT
Hi,

That works fine, thanks!

Now my next test is to get it into the sql-taglib. I tried to use the
data-source key="resDB" and use that but with no luck. I guess the
sql-taglib is looking at the web.xml. I only get "datasource invalid: null"
or "no suitable driver".

	<sql:setDataSource var="ex" scope="application" dataSource="resDB"
/>
		<sql:query var="rader" dataSource="${ex}">
			select Initialer
			from Skytter
		</sql:query>

- Terje


-----Original Message-----
From: news [mailto:news@main.gmane.org] On Behalf Of Yann Cébron
Sent: 8. juli 2003 21:44
To: struts-user@jakarta.apache.org
Subject: Re: Accessing database in java and jsp?


This might be a good start to read:

http://jakarta.apache.org/struts/faqs/database.html

HTH,
    Yann

At 01:31 PM 7/8/03 +0200, you wrote:
>Hello
>
>I have created a datasource in my struts-config.xml. But I cant find out
how
>to use it. Creating my datasource in my web.xml works fine. Any tips?
>
>- Terje
>
>struts-config.xml:
>...
>  <data-sources>
>   <data-source>
>    <set-property value="true" property="autoCommit" />
>    <set-property value="My database" property="description" />
>    <set-property value="com.sybase.jdbc2.jdbc.SybDriver"
>property="driverClass" />
>    <set-property value="10" property="maxCount" />
>    <set-property value="2" property="minCount" />
>    <set-property value="xxxx" property="user" />
>    <set-property value="xxxxx" property="password" />
>    <set-property value="jdbc:sybase:Tds:mycomputer:4000/mydatabase"
>property="url" />
>   </data-source>
>  </data-sources>
>...
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org






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



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


Mime
View raw message