users@glassfish.java.net

RE: JSP dataSource problem

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Thu, 20 May 2010 09:16:46 -0400

$GF_HOME/domains/domain1/domain.xml configure your jdbc-connection-pool e.g.

 

    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="false" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="lyrixPostgres" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
      <property name="datasourceName" value="jdbc/zetowr"/>
      <property name="user" value="sarahpalin"/>
      <property name="password" value="alaskandumpkopf"/>
      <property name="portNumber" value="3306"/>
      <property name="databaseName" value="drillbabydrill"/>
      <property name="serverName" value="localhost"/>
    </jdbc-connection-pool>


then configure your jdbc-resource accessed via jdbc/zetowr to reference pool-name zetowr

    <jdbc-resource enabled="true" jndi-name="jdbc/zetowr" object-type="user" pool-name="zetowr">
      <description>jdbc/zetowr</description>
    </jdbc-resource>

 

//contents of persistence.xml will enumerate which classes will reference your jdbc datasource
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">

    <persistence-unit name="zetowr">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>jdbc/zetowr</jta-data-source>
        <class>com.republican.site1.ExxonValdez</class>
        <class>com.republican.site2.DeepWaterHorizon</class>
   <properties>
      <property name="toplink.logging.level" value="FINEST"/>
   </properties>
    </persistence-unit>
</persistence>

 

HTH
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> Date: Thu, 20 May 2010 05:09:51 -0700
> From: glassfish_at_javadesktop.org
> To: users_at_glassfish.dev.java.net
> Subject: JSP dataSource problem
>
> Hello, I was working with java persistence on glassfish 3 + eclipselink, and everything was good, but then I needed to make some Group By queries, so i decided to make this in JSP.
>
> And here is an error: javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver found for jdbc/zetowr_at_energia"
>
> But the driver is in place, whatsmore, I can use it to use Java Persistance with the same JDBC resource. What might be the problem?
> [Message sent by forum member 'madierfakier']
>
> http://forums.java.net/jive/thread.jspa?messageID=470670
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
                                               
_________________________________________________________________
The New Busy is not the old busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3