I really don't understand what to do. So blurry page for a beginner. Nevertheless, I have created a SessionCustomizer class apart. Here is my customize() method, using c3p0:
public void customize(Session session) throws Exception{
DataSource ds = DataSources.unpooledDataSource("myServerURL", "login", "pwd");
DataSource pooled = DataSources.pooledDataSource(ds);
JNDIConnector conn = (JNDIConnector)session.getLogin().getConnector();
conn.setDataSource(pooled);
conn.setLookupType(JNDIConnector.STRING_LOOKUP);
}
I don't even think it's correct. I'm putting my connection infos in clear in code, really weird.
Secondly, in persistence.xml example from the link, they have put:
<non-jta-data-source>java:comp/env/jdbc/DefaultDS</non-jta-data-source>
<class>sample.MyEntity</class>
<properties>
<property name="toplink.session.customizer" value="es.claro.commons.ds.DataSourceSessionCustomizer"/>
</properties>
What should I put in mine, particularly for "non-jta-data-source" tag? Is there a way to put connection informations in that xml instead of in code?
Help.