[jboss-user] [JBoss Portal] - Not getting JBoss portal datasource
paidadilip
do-not-reply at jboss.com
Wed May 7 05:11:02 EDT 2008
Hi
This is Dileep,
plz give me solution....
I am working Jboss portal, to get the connection i am using JNDI
name, but it is not identyfying it,
and it is giving the org.hibernate.jdbc.GenericJDBCException and
sometimes connetion cant open
This is mysql-ds.xml
datasources>
<local-tx-datasource>
<jndi-name>MySqlDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/jbossportal</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
password
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
This is Portal-mysql5-ds.xml
<local-tx-datasource>
<jndi-name>PortalDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
password
</local-tx-datasource>
</datasources
javax.naming.InitialContext newInitialContext= new
javax.naming.InitialContext();
javax.naming.Context
ctx=(Context)newInitialContext.lookup("java:comp/env");
javax.sql.DataSource ds=(javax.sql.DataSource)ctx.lookup("PortalDS");
java.sql.Connection conn=ds.getConnection();
System.out.println("con..."+conn.getClass());
Error msg is :javax.naming.NameNotFoundException PortalDS not bound
if u know the configuration then plz inform me, waiting for reply...
Thank and Regards,
Dilip
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4149027#4149027
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4149027
More information about the jboss-user
mailing list