aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Java beans + JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Java beans + JDBC" Watch "Java beans + JDBC" New topic
Author

Java beans + JDBC

Ahamed Sharif
Ranch Hand

Joined: Aug 24, 2003
Posts: 47
Hi,
Java Beans can work with JDBC for data base?, if it works
please any one send the tutorials link or helpful tutorials
about Java beans + JDBC.
I need to make components for Data base connections and for gateways.
so my question is java beans work with JDBC??.
I installed JBuilder8 in that i have jdk1.4 so for running
Java beans I need to installed BDK ?
Thanks,
Ahamed
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

http://www.patterndepot.com/put/8/JavaPatterns.htm


Groovy
Faisal Khan
Ranch Hand

Joined: Jun 29, 2003
Posts: 285
Ahamed,
The issue of database connectivity is very important and it depends on what exactly you want to do with Java Beans and JDBC. Most containers provide you with database pools, such as Tomcat JNDI DataSource.
For managing the connection pools etc, that is what you should use. For specific desing, I am still trying to learn how I should make use of design pattern such as DAO.
HTH


The secret to creativity is knowing how to hide your sources.
Ahamed Sharif
Ranch Hand

Joined: Aug 24, 2003
Posts: 47
Originally posted by Faisal Khan:
Ahamed,
The issue of database connectivity is very important and it depends on what exactly you want to do with Java Beans and JDBC. Most containers provide you with database pools, such as Tomcat JNDI DataSource.
For managing the connection pools etc, that is what you should use. For specific desing, I am still trying to learn how I should make use of design pattern such as DAO.
HTH

Hi Faisal,
My Design pattern is one java bean class read the data from data base table
in a data base server. How Java bean communicate with data base?
is it any design pattern is available or any online tutorial for Java Bean
with JDBC communication to the data base server.
If you have please send me.

Thanks,
Ahamed
Faisal Khan
Ranch Hand

Joined: Jun 29, 2003
Posts: 285
Originally posted by Ahamed Sharif:

My Design pattern is one java bean class read the data from data base table in a data base server. How Java bean communicate with data base?
is it any design pattern is available or any online tutorial for Java Bean
with JDBC communication to the data base server.


Ahamed,
Can you please specify the following:
1. what servlet container / app server you using?
2. what database server you using?
3. Do you want a connection each time or have a pool of connections?
There are tonnes of tutorials on this subject matter but you will need to be more specific.
HTH
Ahamed Sharif
Ranch Hand

Joined: Aug 24, 2003
Posts: 47
Originally posted by Faisal Khan:


Ahamed,
Can you please specify the following:
1. what servlet container / app server you using?
2. what database server you using?
3. Do you want a connection each time or have a pool of connections
There are tonnes of tutorials on this subject matter but you will need to be more specific.
HTH


Salam Faisal,
Actually i am developing gateway technolgy. The gate way is a component
based gateway, so i have to use java beans or EJB but i am prefering java beans. Because i am not sure about EJB implementation.
1. I am using Tomcat + Axis
Axis is for Webservices that is later part.
2. I am using Mysql data base.
3. I need both, because first I have to test each time after that
i will go with pooilg connection.
My first part is to develope a component that component read the
data from the mysql data base tabel and then that data pass it to some
other database server through gate way.
So give me suggestions how to start this task and I need any
good tutorials or any old projects related to this topic, if you
have please send me the url, would be really grateful.

Allah hafiz,
Ahamed
Faisal Khan
Ranch Hand

Joined: Jun 29, 2003
Posts: 285
Originally posted by Ahamed Sharif:


Salam Faisal,
Actually i am developing gateway technolgy. The gate way is a component
based gateway, so i have to use java beans or EJB but i am prefering java beans. Because i am not sure about EJB implementation.
1. I am using Tomcat + Axis
Axis is for Webservices that is later part.
2. I am using Mysql data base.
3. I need both, because first I have to test each time after that
i will go with pooilg connection.
My first part is to develope a component that component read the
data from the mysql data base tabel and then that data pass it to some
other database server through gate way.
So give me suggestions how to start this task and I need any
good tutorials or any old projects related to this topic, if you
have please send me the url, would be really grateful.

Allah hafiz,
Ahamed

Salaam Ahamed
I see what you need to do now. I am not sure how far you have got into your setup but after installing Tomcat and MySQL and getting them both to work, you need to get a JDBC driver (i recommned Connector/J from: http://www.mysql.com/products/connector-j/index.html).
The documentation of Connector/J will tell you how to test a single connection and query using a Java class: http://www.mysql.com/documentation/connector-j/index.html
After that follow the instructions in: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html to get your self setup using JNDI DataSource.
HTH
Ahamed Sharif
Ranch Hand

Joined: Aug 24, 2003
Posts: 47
Originally posted by Faisal Khan:

Salaam Ahamed
I see what you need to do now. I am not sure how far you have got into your setup but after installing Tomcat and MySQL and getting them both to work, you need to get a JDBC driver (i recommned Connector/J from: http://www.mysql.com/products/connector-j/index.html).
The documentation of Connector/J will tell you how to test a single connection and query using a Java class: http://www.mysql.com/documentation/connector-j/index.html
After that follow the instructions in: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html to get your self setup using JNDI DataSource.
HTH

Hi,
Thank you i will try this one. But i have a query. in Java already they
defined JDBC API for conncting to dabase server. So why again I need Connector/J JDBC driver?. in java beans JNDI is required to call beans?
Because i know in EJB requires JNDI for lookup, in java beans also the
same thing JNDI lookup?? once I make the components in java bans then
in client programs i need JNDI lookup to find the server components like
EJB or what is the concept of the java beans components??
Salam,
Ahamed.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
in Java already they defined JDBC API for conncting to dabase server. So why again I need Connector/J JDBC driver?.

The JDBC is just an API. Each database vendor must provide an implementation for their product and that implementation must comply with the JDBC API.
in java beans JNDI is required to call beans? Because i know in EJB requires JNDI for lookup, in java beans also the same thing JNDI lookup?? once I make the components in java bans then in client programs i need JNDI lookup to find the server components like EJB or what is the concept of the java beans components??

JavaBeans don't need to be looked up from a JNDI tree. JavaBeans and Enterprise JavaBeans have very little in common. Search this forum for details (the difference between JavaBeans and EJBs is a frequently asked question).


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java beans + JDBC
 
Similar Threads
important!
Java Beans and Java persistance
Java beans and JDBC open source project
Java beans + JDBC
Important!