RE: Configuring SSL

From: Elena Doyle (ed28..dmin.cam.ac.uk)
Date: Wed Jun 18 2008 - 12:05:36 EDT

  • Next message: Andrus Adamchik: "Re: Configuring SSL"

    Andrus,

    I use eclipse.
    How do I place the right Cayenne jar file in the eclipse project classpath? I currently have
    cayenne.jar in the build path, and I assume I need to do something to be able to go new class
    And add from a list of available interfaces, which is currently empty.

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: 18 June 2008 16:56
    To: use..ayenne.apache.org
    Subject: Re: Configuring SSL

    Also if you are using Eclipse or some other IDE, you won't even need the sources, all you need is to
    place the right Cayenne jar file in the IDE project classpath, and then tell the IDE (I am assuming
    Eclipse, not sure how others handle that) that a class you are creating implements a certain
    interface (DataSourceFactory). The IDE will generate method placeholders for you by looking at the
    binary definition of the interface.

    Andrus

    On Jun 18, 2008, at 6:51 PM, Andrus Adamchik wrote:

    > Elena,
    >
    > Getting the sources and JavaDocs for any past version wouldn't be a
    > problem, we are an open source project after all. Here is the archive
    > link:
    >
    > http://www.apache.org/dist/cayenne/
    >
    > So all you need is to determine which version you are currently using.
    > If you don't know that for sure and if your jar file doesn't have it
    > in the name (such as "cayenne-server-3.0M4.jar), you can unpack the
    > jar and look inside:
    >
    > jar xf cayenne.jar
    >
    > and then look for "org/apache/cayenne/cayenne-strings.properties"
    > file - it contains release version #.
    >
    > Hope this helps.
    > Andrus
    >
    >
    > On Jun 18, 2008, at 6:35 PM, Elena Doyle wrote:
    >
    >> Andrus,
    >>
    >> How can I get to the source code or java doc of the version I am
    >> using?
    >> I so do not want to go back to Hibernate
    >>
    >> Elena
    >>
    >>
    >> -----Original Message-----
    >> From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    >> Sent: 18 June 2008 16:31
    >> To: use..ayenne.apache.org
    >> Subject: Re: Configuring SSL
    >>
    >> The DataSourceFactory interface changed between Cayenne releases.
    >> Make sure you implement the
    >> version of the interface matching Cayenne version that you are using.
    >>
    >> Andrus
    >>
    >>
    >>
    >> On Jun 18, 2008, at 5:01 PM, Elena Doyle wrote:
    >>> Andrus,
    >>>
    >>> Thank you.
    >>>
    >>> I have instantiated BasicDataSource but there does not seem to be a
    >>> method available to set properties! The only thing I can see is
    >>> addConnectionProperty(String name, String value)
    >>>
    >>> I used that but now I am left with one an error:
    >>>
    >>> "The type OracleSSLDataSourceFactory must implement the inherited
    >>> abstract method DataSourceFactory.getDataSource(String, Level)???"
    >>>
    >>> Please help if you can
    >>>
    >>>
    >>>
    >>> I do:
    >>>
    >>> import javax.sql.DataSource;
    >>> import org.apache.commons.dbcp.*;
    >>> import org.apache.cayenne.conf.*;
    >>>
    >>> public class OracleSSLDataSourceFactory implements DataSourceFactory
    >>> {
    >>>
    >>> protected Configuration parentConfiguration;
    >>>
    >>> public void initializeWithParentConfiguration(Configuration
    >>> parentConfiguration) {
    >>> this.parentConfiguration = parentConfiguration; }
    >>>
    >>> public DataSource getDataSource(String location) throws Exception{
    >>>
    >>> String url =
    >>> "jdbc:oracle:thin..DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)
    >>> (HOST=servername)(PORT=2484))
    >>> (CONNECT_DATA=(SERVICE_NAME=servicename)))";
    >>>
    >>> BasicDataSource ds= new BasicDataSource();
    >>>
    >>> ds.setUrl(url);
    >>> ds.addConnectionProperty("user", "user");
    >>> ds.addConnectionProperty("password", "password");
    >>> ds.addConnectionProperty("oracle.net.ssl_cipher_suites",
    >>> "(SSL_DH_anon_WITH_3DES_EDE_CBC_SHA, SSL_DH_anon_WITH_RC4_128_MD5,
    >>> SSL_DH_anon_WITH_DES_CBC_SHA)");
    >>>
    >>> return ds;
    >>>
    >>>
    >>>
    >>> }
    >>> }
    >>>
    >>>
    >>>
    >>> -----Original Message-----
    >>> From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    >>> Sent: 18 June 2008 13:13
    >>> To: use..ayenne.apache.org
    >>> Subject: Re: Configuring SSL
    >>>
    >>> No, it is a part of Apache commons-dbcp library:
    >>>
    >>> http://commons.apache.org/dbcp
    >>>
    >>> Andrus
    >>>
    >>>
    >>> On Jun 18, 2008, at 3:06 PM, Elena Doyle wrote:
    >>>> Andrus,
    >>>>
    >>>> What is DBCP BasicDataSource, please? Is it part of your framework?
    >>>>
    >>>> Elena
    >>>>
    >>>> -----Original Message-----
    >>>> From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    >>>> Sent: 16 June 2008 16:55
    >>>> To: use..ayenne.apache.org
    >>>> Subject: Re: Configuring SSL
    >>>>
    >>>> Hi Elena,
    >>>>
    >>>> Here is a (badly written) factory for DBCP:
    >>>>
    >>>> https://svn.apache.org/repos/asf/cayenne/main/trunk/framework/
    >>>> cayenne-
    >>>> jdk1.5-unpublished/src/main/ja
    >>>> va/org/apache/cayenne/conf/DBCPDataSourceFactory.java
    >>>>
    >>>> You can use a similar approach to properties loading, but then
    >>>> instead of doing what we did with DBCPDataSourceProperties/
    >>>> DBCPDataSourceBuilder helper classes, do
    >>>> this:
    >>>>
    >>>> 1. Load a properties file (that will have to include the URL, user
    >>>> name, password, and any of your custom settings) to a
    >>>> java.util.Properties object.
    >>>> 2. instantiate DBCP BasicDataSource, and call its set* methods to
    >>>> populate the properties.
    >>>>
    >>>> Andrus
    >>>>
    >>>> On Jun 16, 2008, at 6:39 PM, Elena Doyle wrote:
    >>>>
    >>>>> Andrus,
    >>>>>
    >>>>> Many thanks for this. Due to bussiness needs I need to write a
    >>>>> custom one. As I am mostly a database and PL/SQL person, is the
    >>>>> source code of the standard Cayenne data factory available
    >>>>> anywhere.
    >>>>> I could not find it in the repository.
    >>>>>
    >>>>> Many thanks
    >>>>>
    >>>>> Elena
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed Jun 18 2008 - 12:06:14 EDT