This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Cpntainer Managed EJB - MS Access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Cpntainer Managed EJB - MS Access" Watch "Cpntainer Managed EJB - MS Access" New topic
Author

Cpntainer Managed EJB - MS Access

smitha rai
Ranch Hand

Joined: Aug 15, 2001
Posts: 33
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

Joined: Jul 28, 2000
Posts: 1845
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

Joined: Jul 28, 2000
Posts: 1845
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

Joined: Jul 05, 2001
Posts: 62
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

Joined: Jun 25, 2001
Posts: 15959
    
  19

Standard disclaimer:
The jdbc-odbc driver is not threadsafe. Data integrity is not guaranteed when using it. WebLogic specifically states this.


Customer surveys are for companies who didn't pay proper attention to begin with.
Nisa Nisa
Greenhorn

Joined: Oct 24, 2003
Posts: 2
did anyone try using CMP2.0 using MS Access Database in Websphere ?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cpntainer Managed EJB - MS Access
 
Similar Threads
Table Oriented Programming
CMR in CMP Entity Beans
VAJava EJB reading MS Access
Prepared Statements
how to connect to MS-Access using weblogic 6.1