Herbert Maosa

Ranch Hand
+ Follow
since May 03, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Herbert Maosa

I am wondering what is the most practical way to use a MIDlet to navigate a recordset returned from a database. I have a servlet that accesses an EJB to obtain a recordset from a database. Then I am using a MIDlet to access the servlet and I am getting the information on the MIDlet ok. But it is only ok now because there is only one record in the recordset, but the full implementation will return hundreds of records, and I am imagining it is not practical to send all the records to the MIDlet at once due to space resource constraints on the midlet. Ideally, I would like to be sending one record at a time to the MIDlet, so that the the user goes to the next button by clicking a "next button". But how do I send one record at time from the servlet to the MIDlet?

any ideas?

Herbert.
19 years ago
This has managed to get me lost a little bit. I have an entity bean that successfully passes a Collection object to a remote client, a servlet. However, the runtime type inside the collection is an ArrayList but I pass it out as a Collection, I wonder if that is what is making the difference.
Good people,

I am wondering if anyone can educate me on how to specify transaction attributes for methods in BMP entity beans. I have a problem that I think is down to transactions not triggering correctly.

I will describe the problem.

I have an entity bean with say two business methods. Call the methods and

I have a home Collection findAll() method that I use to simply return all instaces of products from the database. I do this by simply putting all the primary keys in the Collection.

In my client, which is a servlet, I successfully execute as such


The code snippet above successfully prints the primarykeys from getPrimaryKey(); prints null from the other two methods. So I was thinking that perhaps my instance variables are not being synchoronised with the database prior to calling those methods.

Anyone to take this up?

Thanks.

Herbert.
Are you able to directly connect to the database ( using an SQL interface ) and able to see the record that is assumed to have been created by the appplication?

Herbert..
Good people,

I am wondering if someone can tell me how to create a database in the pointbase database server that comes bundled with the Sun Application Server. I would like to create my own database, as opposed to using the samples database or the sun-appserv-samples that come already configured for the sample application. I am encountering a problem trying to develop for MySql, and I am thinking it could be a problem with the database server, so I would like to try a different database server to make sure..

any help?

Herbert.
Good ranchers,

I am wondering what technique is there to access a web application ( say a servlet ) from a midlet. I have a requirement to develop an end to end java appplication invloving J2EE and J2ME. All is well from the server side, but I ma hitting a blank wall when it comes to using a midlet to get the results from a servlet. The obvous problem is that the servlet is returning html code and my midlet is just dumping the html code on the screen, not interpreting into usable data.

Somebody tell me the trick....

Herbert.
19 years ago
Ladies and Gentlemen,
I have really tried all I can, gone through the tutorials over and over and over. I am really frustaed and I need someone to help me what I am not able to see in my code that is causing my problem. I have described my problem, plus some code snippets in the theread Please Help Me demistify this . I can not get entity beans to execute, the application is giving a nested javax.transaction.RollbackException. I am now wondering, could it be that MySQL Server ver 4.0.18 does not support transactions?? But I have tried using the pointbase server that comes with the J2EESDK as well and the sitiation is the same.
Could y'all tell me what database servers you are using? What can I do. Everything is ok if I code the bean as a Session Bean.
Please Help
Herbert
It appears to me like the problem has to do with transactions ( I am not sure though ).
In the stack trace, the nested exception is javax.transaction.Rollback Exception
I am really lost. I thought it should be straightforward. The exact same logic works for session bean.
Herbert.

Originally posted by Herbert Maosa:
Herewith my code for the ejbCreate and ejbStore. Please help me, I am really stuck here.

The method createUser(String customerID, String firstName, String lastName, String userName, String password ) opens a database connection and executes an SQL insert statement to insert those fields in the database.

The method storeCustomer() invokes an SQL update statement to update the fields firstName, lastName, userName, password from the underlying table.
I have only included the parts of the code that you asked for and I hope you can help me make sense of what is going on.
Thanks,
Herbert.

Herewith the storeCustomer() and the createCustomer() methods




Please Help,
Herbert.
When I enable ejbLoad() and ejbStore() I get humangous stack trace. If I make these empty, the errors disappear but nothing happends on the database.
Please please, Help.
Herewith my code for the ejbCreate and ejbStore. Please help me, I am really stuck here.

The method createUser(String firstName, String lastName, String userName, String password ) opens a database connection and executes an SQL insert statement to insert those fields in the database.

The method storeCustomer() invokes an SQL update statement to update the fields firstName, lastName, userName, password from the underlying table.
I have only included the parts of the code that you asked for and I hope you can help me make sense of what is going on.
Thanks,
Herbert.
1. I am using the Sun Application Server that comes bundled with the J2EE sdk.
2. I am converting it to a BMP Entity Bean.
3. I have not defined or configured any transaction, I don't even know if I need to. All I am trying to do is create records in a database. I can easily create the records if the bean is a session bean.
Please Help.
Herbert.
I have struggle for so long to try and figure this for myself but now my brains have stopped,someone help me.
I am simply trying to get an Entity Bean to create database rows. When I use a session bean, the bean inserts the row without a problem. When I convert the bean to an Entity Bean, I get no errors, but nothing gets inserted into the database. Can someone try to explain to me what is going on here? All the database call remain unchanged, all I am doing is changing the Enterprise Bean type to Entity and implementing the necessary methods.
I would appreciate your help on this, it's got my head spinning.

Herbert.
Raj,
My feeling is that you HAVE to have a primary key for a proper implementation of BMP according to the J2EE spec. After all, a good database design will yield a normalised database that will call for a primary key and eliminate redundancies in the tables.
Herbert.