how to exclude title band in jasper reports when exported as excel - jasper-reports

I have this at top of my jrxml
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="LineChart01" pageWidth="1400" pageHeight="842" columnWidth="1360" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="70d31602-bfb5-4388-9d80-87ea7a72f43d">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="NEW_DATAADAPTER.xml"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<property name="removeEmptySpaceBetweenRows" value="true"/>
<property name="removeEmptySpaceBetweenColumns" value="true"/>
<property name="net.sf.jasperreports.export.csv.exclude.origin.band.title" value="title"/>
<!-- more records ... -->
</jasperReport>
How can I exclude the title band? I tried this. In that link question have few properties to hide some bands those didn't work for me.

Is your title band contains subreport? If yes then you need to use this
<property name="net.sf.jasperreports.export.xlsx.exclude.origin.report.(sameValue)" value="Actual Sub Report Name"/>
<property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.(sameValue)" value="detail"/>
You can change xlsx with pdf, csv, xls etc. I have used detail as value in my second property because my subreport contains only detail band. You can change this with your subreport band.

Related

wildfly not use persistence-unit config

i use this configuration in persistence.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
<persistence-unit name="xxxxx" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>com.behpanel.demo.model.Sessions</class>
<class>com.behpanel.demo.model.Invoices</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.jdbc.url"
value="jdbc:mysql://localhost:3306/qqqqq"/>
<property name="javax.persistence.jdbc.user" value="****"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="javax.persistence.jdbc.password" value="******"/>
<property name="dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.physical_naming_strategy"
value="com.behpanel.demo.config.NamingStrategy"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.use_sql_comments" value="true"/>
<property name="show_sql" value="true"/>
<property name="format_sql" value="true"/>
<property name="use_sql_comments" value="true"/>
</properties>
</persistence-unit>
</persistence>
when run application in intellij idea and deploy on local wildfly server. wildfly dont use this persistence-unit and use default data source.
and crud actions not persist on mysql db and that actions persist on default datasource that is h2 database.

Jasper/iReport - Extra long text does not display properly in excel export

I have a field with excessively long text. When I export the jasper report as xls, the row height does not extend to display the entire content.
Althought the text is present in the cell, the row height needs to be manually increased to see the entire content.
I am using Jasper report version 6.10 and have set the following properties
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="net.sf.jasperreports.export.xls.show.gridlines" value="true"/>
<property name="net.sf.jasperreports.export.xls.one.page.per.sheet" value="false"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>
<property name="net.sf.jasperreports.export.xls.white.page.background" value="true"/>
<property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>
<property name="net.sf.jasperreports.print.keep.full.text" value="true"/>
<property name="net.sf.jasperreports.export.xls.fit.width" value="1"/>
<property name="net.sf.jasperreports.export.xls.wrap.text" value="true"/>
<property name="net.sf.jasperreports.export.xls.print.page.top.margin" value="40"/>
<property name="net.sf.jasperreports.export.xls.print.page.bottom.margin" value="40"/>
<property name="net.sf.jasperreports.export.xls.print.page.left.margin" value="36"/>
<property name="net.sf.jasperreports.export.xls.print.page.right.margin" value="36"/>
<property name="net.sf.jasperreports.export.xls.freeze.row" value="2"/>
<property name="net.sf.jasperreports.export.xls.auto.fit.page.height" value="false"/>
<property name="net.sf.jasperreports.export.xls.fit.height" value="0"/>
Please suggest how I can fix this issue.
Use following properties in Report Element
<staticText>
<reportElement x="0" y="100" width="100" height="20">
<property name="net.sf.jasperreports.export.xls.auto.fit.row" value="true"/>
<property name="net.sf.jasperreports.export.xls.auto.fit.column" value="true"/>
</reportElement>
<textElement/>
<text>
<![CDATA[Your Static Text]]>
</text>
</staticText>
Also I'd recommend you to try using net.sf.jasperreports.export.xls.column.width property, which is more useful. Reference: http://jasperreports.sourceforge.net/config.reference.html

Jasper(Soft) : Use multiple Oracle-Database datasources for single report

I have a Jasper server which has a few templates in one of the folders. I also have an application with a button, and when you click the button it will show a list of all the jasper documents from that folder.
Currently a single parameter (an id) is used in all these Jasper reports, which each use their own query based on what they need.
Now I've added a new jasper template, which has to use a different datasource based on a year parameter, in this same folder.
What I could do is just add this year to the parameter list I send to Jasper for every template in this folder, in which case it will use the id for all the existing templates, and the year for this new one.
However, I prefer to not deploy a new version of this application for the sake of an added jasper template, so I'd like to do the following instead:
Use the parameter id with datasource 1 to query for the year I need
Use this year as parameter with datasource 2 to create the query for the actual jasper report template
So my question: Is this possible? Can a single jasper report have multiple oracle-DB connection datasources? And can I then query for the year in one datasource, to use in the other datasource?
EDIT:
Although the duplicated link gave me a good direction, I'm currently again stuck with the same problem.
What I've done is the following:
I've created the main-report which contains nothing more than a sub-report, and has an id parameter (which will be used to query for the field YEAR in datasource_host_main).
I've created a sub-report with the actual text and lists and such based on a query on datasource_host_sub (with a year parameter).
Here is the code for Main:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.3.1 -->
<!-- 2017-04-10T17:05:30 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Main" language="groovy" pageWidth="595" pageHeight="842" columnWidth="515" leftMargin="40" rightMargin="40" topMargin="20" bottomMargin="20" uuid="3830f8f8-db92-4043-bcbe-4af8cbc24623">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="datasource_host_main"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="ireport.jasperserver.url" value="my_jasper_server_host/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="superuser|"/>
<property name="ireport.jasperserver.reportUnit" value="/users/user_1/reports/Systeem/Main"/>
<property name="ireport.jasperserver.report.resource" value="/users/user_1/reports/Systeem/Main_files/main.jrxml"/>
<parameter name="id_parameter" class="java.lang.Integer">
<parameterDescription><![CDATA[id_parameter]]></parameterDescription>
<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[select dataYear
from MY_TABLE
where id = $P{id_parameter}]]>
</queryString>
<field name="dataYear" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="28" splitType="Stretch"/>
</title>
<detail>
<band height="210" splitType="Stretch">
<subreport>
<reportElement x="6" y="10" width="504" height="200" uuid="e130bc4e-f114-4bd1-b408-dc9ce261b18c"/>
<subreportParameter name="dataYear">
<subreportParameterExpression><![CDATA[$F{dataYear}]]></subreportParameterExpression>
</subreportParameter>
<!-- This below doesn't work: I want to connect to a different datasource in the sub-report -->
<connectionExpression><![CDATA[oracle.jdbc.driver.OracleDriver.getConnection("jdbc:oracle:thin:#datasource_host_sub:1234:ab", "USERNAME", "PASSWORD")]]></connectionExpression>
<subreportExpression><![CDATA["subreport.jrxml"]]></subreportExpression>
</subreport>
</band>
</detail>
<columnFooter>
<band/>
</columnFooter>
<pageFooter>
<band height="39"/>
</pageFooter>
</jasperReport>
Subreport:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.3.1 -->
<!-- 2017-04-10T16:37:07 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="subreport" language="groovy" pageWidth="595" pageHeight="842" columnWidth="515" leftMargin="40" rightMargin="40" topMargin="20" bottomMargin="20" uuid="3830f8f8-db92-4043-bcbe-4af8cbc24623">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="datasource_host_sub"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="ireport.jasperserver.url" value="my_jasper_server_host/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="superuser|"/>
<property name="ireport.jasperserver.reportUnit" value="/users/user_1/reports/Systeem/Main"/>
<property name="ireport.jasperserver.report.resource" value="/users/user_1/reports/Systeem/Main_files/subreport.jrxml"/>
<parameter name="dataYear" class="java.lang.Integer">
<parameterDescription><![CDATA[dataYear]]></parameterDescription>
<defaultValueExpression><![CDATA[YEAR( )]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[select NOTES
from MY_TABLE
where extract(year from to_date(DATE, 'dd-MM-yy')) = $P{dataYear}]]>
</queryString>
<field name="NOTES" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="140" splitType="Stretch"/>
</title>
<detail>
<band height="60" splitType="Stretch">
<textField>
<reportElement x="0" y="18" width="510" height="30" uuid="ed29caa8-a839-4457-a270-68bfedcfadb8"/>
<textFieldExpression><![CDATA["Test: " + $F{NOTES}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band/>
</columnFooter>
<pageFooter>
<band height="20"/>
</pageFooter>
</jasperReport>
The Main report uses datasource_host_main, and the sub-report uses datasource_host_sub. Because a Jasper report has only one .properties file with one jasperDatasourceUri, I can only define datasource_host_main. But how can I define datasource_host_sub for the sub-report? As you can see in the mainreport code I tried to do something like this:
<connectionExpression><![CDATA[oracle.jdbc.driver.OracleDriver.getConnection("jdbc:oracle:thin:#datasource_host_sub:1234:ab", "USERNAME", "PASSWORD")]]></connectionExpression>
But unfortunately it gives this error:
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: oracle.jdbc.driver.OracleDriver.getConnection("jdbc:oracle:thin#datasource_host_sub:1234:ab", "USERNAME", "PASSWORD")
What should I put here instead to make it work (both are Oracle databases), and is it even possible to do it like this?
As I said in my original question:
Can a single jasper report have multiple oracle-DB connection datasources? And can I then query for the year in one datasource, to use in the other datasource?
In JasperReports Server you can use a different data source/DB connection for a subreport or subdataset by setting the com.jaspersoft.jrs.data.source property as the data source repository path at (sub)report or subdataset level.
In your case, you would have the report unit use a data source that connects to datasource_host_main, and the following property in the subreport JRXML:
<property name="com.jaspersoft.jrs.data.source" value="/datasources/host_sub_datasource"/>
where /datasources/host_sub_datasource is the repository path of a data source resource that connects to datasource_host_sub.
Outside JasperReports Server, the same thing can be achieved with data adapters (which replace JasperReports Server data sources). The property to set is net.sf.jasperreports.data.adapter, and it needs to point to a path/resource/URI for a data adapter XML file.

JPA Change default Flushmode from AUTO to COMMIT

I've tried several ways to change the FlushMode to the complete application.
Is this right or is there another way to do it?
I don't want to do this pragmmatically.
This is was what i find as property but it isn't work.
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="myPU">
<properties>
...
<property name="hibernate.connection.autocommit" value="false"/>
<!-- Also tried this: -->
<property name="org.hibernate.FlushMode" value="commit"/>
...
</properties>
</persistence-unit>
</persistence>
Update:
I've created the class as described in the link by zxcf, but i can't figure out how to add this construct in my persistence.xml.
<property name="jpaDialect">
<bean class="test.jpa.vendor.HibernateJpaDialect">
<property name="flushMode" value="MANUAL"/>
</bean>
</property>
Try this
<property name="org.hibernate.flushMode" value="COMMIT"/>
Testing this on a standalone program I can see the changed value of underlying Hibernate Session / EntityManager from AUTO to COMMIT
Here is my persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="JPATest" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>com.test.TestEntity</class>
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.use_sql_comments" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.archive.autodetection" value="class, hbm"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.username" value="xxx"/>
<property name="hibernate.connection.password" value="xxx"/>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test?createDatabaseIfNotExist=true"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory"/>
<property name="hibernate.cache.provider_configuration" value="classpath:ehcache.xml"></property>
<property name="hibernate.use.second.level.cache" value="true"/>
<property name="hibernate.cache.region_prefix" value="neutrino.jpa.cache"/>
<property name="hibernate.cache.use_query_cache" value="false"/>
<property name="hibernate.generate_statistics" value="true"/>
<property name="hibernate.jdbc.batch_size" value="10"/>
<property name="hibernate.order_updates" value="true"/>
<property name="hibernate.order_inserts" value="true"/>
<property name="org.hibernate.flushMode" value="COMMIT"/>
</persistence-unit>
</persistence>
And here is how I test it
EntityManagerFactory emf = Persistence.createEntityManagerFactory("JPATest");
EntityManager em = emf.createEntityManager();
Session session = em.unwrap(Session.class);
System.out.println("Underlying Hibernate session flushmode ####### "+session.getFlushMode());
System.out.println("EntityManager flushmode ####### "+em.getFlushMode());
This gives me
Underlying Hibernate session flushmode ####### COMMIT
EntityManager flushmode ####### COMMIT
If I omit the property in presistence.xml, I get this
Underlying Hibernate session flushmode ####### AUTO
EntityManager flushmode ####### AUTO
Ancient Hibernate 3.2.4.sp1 from JBoss 4.2.3.GA supports only the following notation:
<property name="flush-mode" value="commit"/>

openJPA's persistence.xml configuration

Earlier in my project I was using a combination of Hibernate 3.3.2, openJPA 2.1.1 to connect to the database and retrieve the information from table. Now I want to remove Hibernate and use openJPA for doing connection and retrieving the information.
My earlier configuration of persistence.xml was
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_2_0.xsd">
<persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.connection.url" value="jdbc:mysql://10.10.10.10:3306/test?autoReconnect=true"/>
<property name="hibernate.connection.username" value="user"/>
<property name="hibernate.connection.password" value="pwd"/>
<property name="hibernate.generate_statistics" value="true"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.OSCacheProvider"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.c3p0.min_size" value="5"/>
<property name="hibernate.c3p0.max_size" value="20"/>
<property name="hibernate.c3p0.timeout" value="1800"/>
<property name="hibernate.c3p0.max_statements" value="50"/>
<property name="hibernate.c3p0.idle_test_period" value="1800"/>
<property name="c3p0.idleConnectionTestPeriod" value="1810"/>
</properties>
</persistence-unit>
</persistence>
Now I want to move to openJPA 2.1.1 and for that my persistence.xml file is
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="TestOpenJPAPersistence" transaction-type="RESOURCE_LOCAL">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://10.10.10.10:3306/test?autoReconnect=true"/>
<property name="javax.persistence.jdbc.user" value="user"/>
<property name="javax.persistence.jdbc.password" value="pwd"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionFactoryProperties" value="MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=1800000"/>
<property name="openjpa.Log" value="File=E:\\temp\\TestOpenJPAPersistence\\org.apache.openjpa.log, DefaultLevel=DEBUG, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
<property name="openjpa.jdbc.DBDictionary" value="org.apache.openjpa.jdbc.sql.MySQLDictionary"/>
<property name="openjpa.DataCache" value="true"/>
<property name="openjpa.QueryCache" value="true"/>
</properties>
</persistence-unit>
</persistence>
My question is what are the replacement property for following hibernate property in openJPA
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.OSCacheProvider"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.c3p0.min_size" value="5"/>
<property name="hibernate.c3p0.max_size" value="20"/>
<property name="hibernate.c3p0.timeout" value="1800"/>
<property name="hibernate.c3p0.max_statements" value="50"/>
<property name="hibernate.c3p0.idle_test_period" value="1800"/>
After many trial and error I have found some replacement parameters. My present persistence.xml file looks like
persistence.xml:
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<properties>
<property name="openjpa.ConnectionURL" value="jdbc:mysql://xx.xx.xx.xx:3306/dbname"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionUserName" value="xxx"/>
<property name="openjpa.ConnectionPassword" value="xxx"/>
<property name="openjpa.DynamicEnhancementAgent" value="true"/>
<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
<property name="openjpa.Log" value="SQL=TRACE"/>
<property name="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=60000"/>
</properties>
For connection pooling information check and for all OpenJPA Properties check
Hope this helps