This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Hi I am new to EJB. I could successfully execute stateless and statefull session beans. Now have to start with Entity bean. I have gone thru some examples on site but they seems to be very confusting and tough. Can any one tell me how to start with entity bean? where can I get simple examples with database design? Can I go with MSsql? If any one has the sample code please send me that to email@example.com Thanking you in advance Saradhi
The most important is to read the tutorial of your application server and your deployment tool. you have to find out, how to connect table and bean... the entity-bean itself is easier than a session bean.
Originally posted by saradhi java: Hi I am new to EJB. I could successfully execute stateless and statefull session beans. Now have to start with Entity bean. I have gone thru some examples on site but they seems to be very confusting and tough. Can any one tell me how to start with entity bean? where can I get simple examples with database design? Can I go with MSsql? If any one has the sample code please send me that to firstname.lastname@example.org Thanking you in advance Saradhi
Could you provide some details on the container (i.e. web application server that you are using) Yes Entity Beans are a little bit more challenging to understand and write. When dealing with Entity Beans you have two choices for persistence .. Container Managed or Bean Managed. The Deployment Descriptor allows you to declare which one you use to communciate with the database. From my experience ... you need to know SQL very well to write BMP Entity Beans. For CMP, the container handles most of the nitty gritty details of SQL. If you are writing custom finders for CMP it does get a little complicated but manageable with some practice. The tutorials on java.sun.com are a great way to get your feet wet with EJBs. Lots of sample code and good examples. You can go with pretty much any ODBC compliant database because (hopefully) the container/web app server is using JDBC and you can get away with using the jdbc dbc bridge. If you have the type 4 MSSQL (Microsoft SQL server) jdbc driver, you will learn a Entity Beans a lot faster :-) not really, but the database access will be faster. If you don't have a type 4 driver and would like to have the right environment for learning JDBC and EJB, you should take a look at MySQL. Very powerful full feature OpenSource RDBMS and it is priced just right $0.00. You can download the jar file that has the JDBC driver from the web site http://www.mysql.com/
I concur entirely - start with CMP managed entity beans and you should find things alot easier. Which version of SQL server? SQL Server 2000 has (currently) free JDBC drivers available from microsoft, other versions things can be a bit more difficult. I would also agree that another database like mySQL where the drivers are easier to source is a definate benefit. If you want to easily see entity beans in action grab the trial enterprise version of Forte or JBuilder from their respective sites. This then allows you to autogenerate the beans from the database schema. Then at least you can play around with some working example beans
The Eagle sneers at the Peacock<p>Systems Administrator<br />OrderWare Solutions Ltd<br /><a href="http://www.orderware.net" target="_blank" rel="nofollow">http://www.orderware.net</a>