0
votes

Ok, I got one of our JAVA/JDBC guys to come take a look at my JDBC issue as documented in http://stackoverflow.com/questions/9787525/jdbc-ordeal-it-shouldnt-be-that-difficult-partial-solved-new-errors It seems that if I put ojdbc14 as the ConnectionName I get this error:

Error while reading the relational data
Error while loading connection ojdbc14
Error parsing XML stream
InputStream cannot be null

But if I put ojdbc14.jdbc as the ConnectionName I get this error:

Error while reading the relational data
comp/env/jdbc/ojdbc14.jdbc

He seems to think that the second version is the one that should be used, but that there is some missing configuration on the server, like JNDI name or something like that.

I need someone to confirm that one or the other of these is the correct format and what exactly has to be done of the server side for it to find the connection information.

Any help would be appreciated.

MJ

2

2 Answers

1
votes

See http://www.openntf.org/internal/home.nsf/response.xsp?action=openDocument&documentId=7888655D70FDDD6186257930002E1D3F&MainID=D861DE698262EDDA86257930002AEE52 for an example how to connect to MS SQL. It might give you some ideas, since JDBC is more or less the same for any RDBMS. See specifically point 1. It's not enough to put the .jar to plugins folder. It needs to be as plugin.

See http://www-10.lotus.com/ldd/ddwiki.nsf/dx/creating_an_xpages_library for instructions how to create a plugin.

Update I did try it from scratch with H2 database engine. Following works:

1) I imported JDBC driver to WebContent/WEB-INF/lib

2) I did create WebContent/WEB-INF/jdbc/h2.jdbc with following content

<jdbc>
    <driver>org.h2.Driver</driver>
    <url>jdbc:h2:tcp://localhost/~/test</url>
    <user>SA</user>
    <password></password>
</jdbc>

3) Create a simple Xpage with following content. I marked with bold part where connection defined in (2) is specified.

<xp:viewPanel rows="10" id="viewPanel1" var="user">
    <xp:this.facets>
        <xp:pager partialRefresh="true" layout="Previous Group Next"
            xp:key="headerPager" id="pager1">
        </xp:pager>
    </xp:this.facets>
    <xp:this.data>
        <xe:jdbcQuery connectionName="h2" sqlQuery="select * from test"
            var="jdbcData1" defaultOrderBy="id">
        </xe:jdbcQuery>
    </xp:this.data>
    <xp:viewColumn id="viewColumn1" columnName="id">
        <xp:this.facets>
            <xp:viewColumnHeader xp:key="header" id="viewColumnHeader1"
                value="ID" sortable="true">
            </xp:viewColumnHeader>
        </xp:this.facets>
    </xp:viewColumn>
    <xp:viewColumn id="viewColumn2" columnName="name">
        <xp:this.facets>
            <xp:viewColumnHeader xp:key="header" id="viewColumnHeader2"
                value="NAME" sortable="true">
            </xp:viewColumnHeader>
        </xp:this.facets>
    </xp:viewColumn>
</xp:viewPanel>

Will try reproduce it later in Oracle 11g Express Edition.

UPDATE #2

For Oracle 11 XE Release 2 it works exactly the same, with only one exception. I had to follow http://www-01.ibm.com/support/docview.wss?uid=swg21279509 to grant following rights:

grant {
    permission java.lang.RuntimePermission "getClassLoader";
}

In addition, I used ojdbc6.jar as advised in Oracle documentation, due to fact that Domino 8.5.3 uses Java 6. Of course, my initial statement with adding Oracle JDBC driver to Domino in form of a plugin, since this will allow you to use it in every XPages application.

0
votes

MJ,

I just found this post. By adding the .jdbc extension we seemed to have bypassed the DOM parser error. Your XML is now not throwing an Exception, but simply placing ojdbc14.jar on the Domino server will not create a JNDI name on that server. It will simply put the Java bytecode on that server that will be needed for the Oracle connections - the code part, but not the configuration.

The file ojdbc14.jdbc contains all of the information that the server would need to create the JNDI lookup name, but the details of registering it on the server as you mentioned are what I can't find the instructions for so far.