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

Which package is used for jdbc application?

982


How can I create a custom RowSetMetaData object from scratch?

1006


What is the difference between setmaxrows(int) and setfetchsize(int)?

1059


Is jdbc object oriented?

943


Under what circumstances, that all four drivers are used?

2414


What is the meaning of batch updates?

1096


What is the purpose of the jdbc resultset interface?

914


Can we return resultset in java?

928


How we store procedure in oralce for callable statements in jdbc

2335


What are the higher level apis under development on top of jdbc currently?

969


What is connection data?

911


What is a jdbc url?

902


What are the three parts of a jdbc url?

1024


What are the advantages of database connection pooling?

919


What is difference between statement and preparedstatement in jdbc?

910