• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Java beans + JDBC

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.patterndepot.com/put/8/JavaPatterns.htm
 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ahamed Sharif
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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).
 
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny ad ...
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic