RPC MySQL JDBC Tomcat example

48 views
Skip to first unread message

pierrot

unread,
Jul 3, 2006, 9:30:04 AM7/3/06
to Google Web Toolkit
Hi everyone,

I've created an RPC application from two applications that were
previously designed by Robert Cooper
(http://www.onjava.com/pub/a/onjava/2006/05/31/working-with-google-web-toolkit.html)
and Parvinder Thapar
(http://psthapar.googlepages.com/simplesortabletable).

I've jarred the following two files that can be downloaded from:

http://www.geocities.com/plasante/RpcMysqlTomcat.jar

and

http://www.geocities.com/plasante/MyAPP02_RPC.jar

The RpcMysqlTomcat.jar file contains the client side code of the
application and the MyAPP02_RPC.jar contains the server side code that
can be deployed to a Tomcat server.

The main purpose of the application is to read a table from a MySQL
database and then populate a FlexTable that can be dynamically sorted
on the client side.

The modules can be run as is except for the database server name,
database name, username, and password that have to be adjusted
accordingly.

I'm not going to write all the steps to setup this application but I
provide how to setup the database and a single table in a MySQL command
line tool:

mysql> create database flex;

mysql> use flex;

mysql> CREATE TABLE `employees` (
`First_name` varchar(45) NOT NULL default '',
`Last_name` varchar(45) NOT NULL default '',
`Days` int(10) unsigned NOT NULL default '0',
`Hire_date` datetime NOT NULL default '0000-00-00
00:00:00',
`Bonus` float NOT NULL default '0'
ENGINE=InnoDB);

mysql> insert into employees
(First_name, Last_name, Days, Hire_date, Bonus)
values('Pierre', 'Lasante', '30', '1955/12/05', 4.33);

mysql> insert into employees
(First_name, Last_name, Days, Hire_date, Bonus)
values('Karo', 'Spenard', '31', '1962/11/18', 5.44);

mysql> insert into employees
(First_name, Last_name, Days, Hire_date, Bonus)
values('Juby', 'Spenard', '32', '1988/05/25', 6.55);

mysql> insert into employees
(First_name, Last_name, Days, Hire_date, Bonus)
values('Ginger', 'Spenard-Lasante', '33', '2005/12/28',
7.66);

Well that's it for the moment.

Cheerio.

Gasgas

unread,
Jul 7, 2006, 11:23:14 AM7/7/06
to Google Web Toolkit
Thanks Pierrot,

i am getting closer to the answer. It is already two weeks that i got
to know gwt and i am trying to make my first database connection.
I found on my server the possibility to use MySQL (even if i am new to
it) so i tried to read your jar file uplisted

but actually i dont know how to place or to use them.
Dont you have a concrete example to post?


Thanks,


Gasgas

pierrot

unread,
Jul 7, 2006, 8:09:44 PM7/7/06
to Google Web Toolkit
As I said I merged two tutorials into a third one to make a complete
RPC, JDBC, Tomcat, and MySQL example. It would rather be quite a long
post if I were to post the java source in this forum.

I would highly suggest that you study and try to implement the two
tutorials provided in my post by Robert Cooper and Parvinder Thapar and
then come back to study and try to implement my example. I tried to
keep it very simple and I can't think how I could further simplify it.

Cheerio.

Reply all
Reply to author
Forward
0 new messages