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...


In selenium testing how to connect with database , any one

pls give the entire information

Answers were Sorted based on User's Feedback



In selenium testing how to connect with database , any one pls give the entire information..

Answer / guest

Just create a java class for jdbc connection, call it when
you need to connect to database. to crate a jdbc connection
class please follow
http://www.roseindia.net/jdbc/jdbc-mysql/MysqlConnect.shtml

Is This Answer Correct ?    2 Yes 0 No

In selenium testing how to connect with database , any one pls give the entire information..

Answer / sandip

public class dbconnection
{
public static void main(String args[])
{
String email;
String dbUrl = "jdbc:mysql://localhost:3306/test"; //This
URL is based on your IP address
String username="username"; //Default username is root
String password="password"; //Default password is root
String dbClass = "com.mysql.jdbc.Driver";
String query = "Select email from users where user_id = 1;";

try
{

Class.forName(dbClass);
Connection con = DriverManager.getConnection
(dbUrl,username,password);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);

while (rs.next())
{
dbtime = rs.getString(1);
System.out.println(email);
} //end while

con.close();
} //end try

catch(ClassNotFoundException e)
{
e.printStackTrace();
}

catch(SQLException e)
{
e.printStackTrace();
}

} //end main

} //end class

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Automation Testing AllOther Interview Questions

Could someone educate me on automation testing process followed in a company. I have a vague idea, but i need concrete answers. And thank you all in advance.

0 Answers  


How will you choose a tool for test automation?

1 Answers  


What is the purpose of the wrun.ini file?

0 Answers  


How to write output data to a file (txt,csv,excel) using Test complete automation tool?

2 Answers  


hi i would like to know is there any training institue for Calabash,robotium and ui automator in hyderabad...urgent

0 Answers  


what is the difference between winrunner,loadrunner,qtp,silktest,rational robo?

1 Answers  


What is use of writing Test cases

2 Answers   Ordain Solutions,


test cases test wheather window? test cases to test calculaor? test cases to test a reverse string program? test cases to test program{ int.parse(sting str) $return (int)}? test cases to test program{display string length}?

0 Answers   Adobe, Microsoft,


What are the frameworks available in rc?

0 Answers  


What are the advantages of the automation framework?

0 Answers  


Give some examples of priority – severity defect levels.

0 Answers  


What is extreme programming and what has it got to do with testing?

0 Answers  


Categories