Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cpntainer Managed EJB - MS Access

 
smitha rai
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run a container managed EJB using MS Access (2000)as Database. Once I run the clinet application, I get the following exception.
[Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented at sun.jdbc.odbc.JdbcOdbc.createSQLException.
I wanted to know whether MSAccess supports Container Managed Persistence or not? If it supports, please let me know what feature I should include?
 
Rahul Mahindrakar
Ranch Hand
Posts: 1868
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
smitha_rai
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
Rahul Mahindrakar
Ranch Hand
Posts: 1868
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I hope you are using the J2EE reference implementation. In this case I think that you will not be able to use the CMP for either Session or Entity beans. The default.properties file also has no reference to how i can connect to MSAccess.
But if you are planning for BMP, I think it just is possible to do it and only with Entity Beans. This is because BMP is possible only for entity beans. You can do it by set it by having the Jdbc:ODBC driver in your classpath in the default.properties file. But I haven't ever tried it so I cannot say for sure.
 
Mahesh Kulkarni
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Smitha,
In properties file of Weblogic,create one more connection pool like this.
weblogic.jdbc.connectionPool.ODBCPool=\
url=jdbc dbc:dsnname,\
driver=sun.jdbc.odbc.JdbcOdbcDriver,\
loginDelaySecs=1,\
initialCapacity=4,\
maxCapacity=50,\
capacityIncrement=2,\
allowShrinking=true,\
shrinkPeriodMins=15,\
refreshMinutes=10,\
testTable=dual,\
props=user=;password=;server=demo
# Add a TXDataSource for the connection pool:
weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.ODBCPool=ODBCPool
#
# Add an ACL for the connection pool:
weblogic.allow.reserve.weblogic.jdbc.connectionPool.ODBCPool=everyone
dsnname=any dsn name you have created on your pc.If not created create one and put that name here.
In EJB jar file give the reference of the ODBCPool as follows.
This will work for session beans. Even I've tried with Excel Driver loaded on my m/c.
<resource-ref>
<res-ref-name>jdbc/ODBCPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Accesing the data as well as inserting in any table through the dsn is possible.
I've not tried with Entity Bean.But I feel as per your query some exception is thrown and there should be some solution for the same.If I get it I'll come back to you.

Thanx
Mahesh
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18157
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Standard disclaimer:
The jdbc-odbc driver is not threadsafe. Data integrity is not guaranteed when using it. WebLogic specifically states this.
 
Nisa Nisa
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did anyone try using CMP2.0 using MS Access Database in Websphere ?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul Mahindrakar:
smitha_rai
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.

Unfortunately "smitha" still doesn't cut it. You need both a first name (or initials) and a last name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic