What type of database are your trying to connect to ?
Assuming you're using mySQL here are the steps
You need to JDBC ,
you have to do following steps
Load Driver for mysql like
class.forname("sun.jdbc.odbc")
Then using DriverManger class you can get Connection object.in this method you will pass database url, and databae username and password.
Then create statement object from connection object like
connection.createStatment()
and then use statement object to invoke your sql query.
you can find lots of jdbc example on net.
and also to load driver you need to download driver jar.
drivers are basically jdbc implementation for specific database from different vendors.
For example on how to implement it goto this website:
http://www.roseindia.net/jdbc/jdbc-m...lConnect.shtml
Hope this helps !!
- Moddster
Hello there......? Can please help me with this problem. how to connect java to database? can give me some codes example? please.... I am new in java.....is their anyone could help out there?
Thanks in advanced and Merry Christmas!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!