Although http://tomee.apache.org/configuring-datasources.html mentions the "classpath" attribute,
this is not mentioned in the "Supported Properties" list at http://tomee.apache.org/datasource-config.html
.
-----Original Message-----
From: Daniel Cunha [mailto:danielsoro@gmail.com]
Sent: Tuesday, August 02, 2016 2:10 PM
To: TomEE Users <users@tomee.apache.org>
Subject: Re: Define datasource, reference JDBC driver, and see init in console
Hi David,
yea, resources on TomEE is a mix (XML/Properties) Your definition should following the pattern:
<Resource id="jdbc/sus2" type="DataSource">
maxActive = 5
maxIdle = 2
maxWait = 10000
driverClassName = oracle.jdbc.driver.OracleDriver
url = jdbc:oracle:thin:@<host>:1521:<sid>
username = <user>
password = <password>
</Resource>
References you can see here: http://tomee.apache.org/datasource-config.html
About maven, should be enough have the configuration in your settings.xml.
:)
On Tue, Aug 2, 2016 at 5:52 PM, KARR, DAVID <dk068x@att.com> wrote:
> (I posted this first to tomcat-user, but I realized technically it
> should go to tomee-user. I apologize if this is a duplicate for you.
> In any case, this note has a little more info than the first note.)
>
> I'm attempting to use Tomcat(tomee) to run a REST service that will
> return some data from some SQL queries (Oracle). I've installed Tomee
> 7.0.1, which uses Tomcat 8.5.3.
>
> The JDBC driver is available from a private enterprise maven repo.
> I'd prefer to get it from there, as opposed to storing it locally. I
> noticed at http://tomee.apache.org/configuring-datasources.html ,
> there is the possible notation of "mvn:g:a:v" for the "classpath"
> attribute. However, I don't see any way to configure the Maven repositories this will
reference.
> How do I tell it to look in a particular repo for this? Would it just
> implicitly use my $HOME/.m2/settings.xml file?
>
> My Resource definition in "conf/tomee.xml" looks something like this:
> -----------------------
> <Resource id="jdbc/sus2" type="DataSource"
> maxActive="5" maxIdle="2" maxWait="10000"
> driverClassName="oracle.jdbc.driver.OracleDriver"
> url="jdbc:oracle:thin:@<host>:1521:<sid>"
> username="<user>" password="<password>"/>
> ----------------
>
> Does this look correct? I find the Tomcat docs confusing, with
> respect to the required syntax for this. It's not clear whether a
> pure XML syntax is required, or a mixed XML/property syntax.
>
> If I start the instance, should I see any default output that will
> show Tomcat connecting to this datasource? If it doesn't show this by
> default, is there a way to turn this on?
>
> I tried writing the code to obtain the JNDI resource (Spring context
> references), but it just says it can't find it (fails at "jdbc"), so
> perhaps my Resource definition was ignored, or my JNDI path is wrong.
>
--
Daniel Cunha
https://twitter.com/dvlc_
http://www.tomitribe.com
http://www.tomitribe.io
|