Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how can connection with oracle10g with java

Answer Posted / kishan

package dao;
import java.sql.Connection;
import java.sql.DriverManager;
public class Database {
static final String USERNAME="hr";
static final String PASSWORD="hr";

public static Connection getConnection()
{
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:XE",
USERNAME, PASSWORD);
return con;
}
catch(Exception ex) {
System.out.println(ex.getMessage());
return null;
}
}
}

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is connection commit?

871


What is jdbc explain?

856


How to connect html page to database using jdbc?

844


What is jdbc and odbc in java?

866


What are the conditions applies to varchar variable, when using in procedures?

2083


What is jdbc stand for?

867


What are devices?

899


Give steps to connect to the db using jdbc?

967


What are the new features added to JDBC 4.0?

904


What are the steps to connect to the database in java?

910


What is an SQL Locator?

1031


What do you understand by jdbc datasource?

962


Where is jdbc used?

915


How to achieve JDBC Connection Pooling using JDBC DataSource and JNDI in Apache Tomcat Server?

962


Is jdbc and orm?

879