Hello !

i am encountering problems by trying to initialize a
Database Connnectionpool.

in struts-config.xml I got the entries:

....

<data-sources>
        <data-source
                autoCommit="false"
                description="H2O DATENBANKTEST"
                driverClass="org.gjt.mm.mysql.Driver"
                maxCount="15" minCount="2"
                url="jdbc:mysql://IP/DBname"
                user="username"
                password="******"
                key="theKey"/>
</data-sources>

....

but by trying to acces these values by the call

 try {
     GenericDataSource dataSource =
(GenericDataSource)servlet.getServletContext().getAttribute(Action.DATA_SOUR
CE_KEY);
      conn = dataSource.getConnection();

      .....
         //here are my MySQL instructions etc......

I got a NULLPOINTEREXCEPTION
If I initialize these values directly via the call
        dataSource.setAutoCommit(false); Etc....  inside the method
erverything works.

BUT I HAVE TO READ THESE VALUES FROM THE STRUTS-CONFIG!
WHO CAN HELP A POOR FRUSTRATED JSP DEVELOPER (BEGINNER) ?


Reply via email to