Jump to content
xisto Community
amit nigam

Want Help In Connecting DB To Java

Recommended Posts

Actually i know how to create an independent database and how to update it manually.But i just want to know that how can i make that update thing automatically. Like suppose if i give somekind of username and password to members of my site and i wish to have them updated , like addition , deletion or changes in password, to be automatic how can i do that.i have a rough idea that it can be done with the help of Java and jdbc but i don't know exactly. I m good at programming languages C and Java.

Share this post


Link to post
Share on other sites

I m good at programming languages C and Java.

Yes, C language is the best way, the most performing if you have a lot of users. However, are you familiar with the embedded C for your database ? By the way, which database manager are you using ? Is it a mysql database ?
I guess that most of people here use mysql with php, so they will suggest you to use php. Maybe the most efficient thing is look aroung this forum or make a google search for php sample scripts, understand the examples and adapt them to your own purposes.
Regards
Yordan

Share this post


Link to post
Share on other sites

Actually i know how to create an independent database and how to update it manually.
But i just want to know that how can i make that update thing automatically. Like suppose if i give somekind of username and password to members of my site and i wish to have them updated , like addition , deletion or changes in password, to be automatic how can i do that.

i have a rough idea that it can be done with the help of Java and jdbc but i don't know exactly. I m good at programming languages C and Java.



Check out this site for examples on how to set up the ODBC/JDBC connection. It's pretty simple to do with the help of examples.

http://forums.xisto.com/no_longer_exists/

Share this post


Link to post
Share on other sites

Actually i know how to create an independent database and how to update it manually.

 

But i just want to know that how can i make that update thing automatically. Like suppose if i give somekind of username and password to members of my site and i wish to have them updated , like addition , deletion or changes in password, to be automatic how can i do that.

 

i have a rough idea that it can be done with the help of Java and jdbc but i don't know exactly. I m good at programming languages C and Java.

 


I dont know exactly if i got your question right.. It is kind of not very clear..

 

for automation, here is what i do..

 

--

 

this is on assumption that you have a host with mySQL 5 in it or that you can upgrade the mySQL server on the site/host.

 

I create all needed database tables and coloumns then I write a stored procedure to be inserted to the mySQL server [Oracle style]. Then when I need to do some updates, I just call the stored procedure, the function of the stored procedure is base on your likings.

 

My best setup is also to set a trigger command in the mySQL like a trigger of database read. On a read command [sELECT command for the database], i will just call a stored procedure found also inside the database that will update the read count column for the database I am using.

 

eg.

table data

id INT

data varchar

readcount int

 

trigger SELECT

 

stored procedure sub updatecount[.....]

{....}

 

 

when a user use SELECT command here to the data , my read triiger will fire off

then the trigger will call this stored procedure updatecount and the readcount will be updated.

Edited by vhortex (see edit history)

Share this post


Link to post
Share on other sites

It sounds to me like you need to do some homework on how you want to get this done. There are many many ways to get this done. I would resommend using Java, its the easiest of them all.Using Java you have several options.1. Use JDBC - very very simple especially if you are used to SQL queries and so on.2. Use Persistence Objects - Advanced stuff. For Example EJBs, Hibernate e.t.c

Share this post


Link to post
Share on other sites

you need to use the triggers mechanism in the database to do the effect and connect the database to the java or any other front end mechanism and as daniel said you need to do a lot of home work before connecting the databases

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.