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

What automated tools are you familiar with?

1 Answers  


What are the scripting languages used in WinRunner, LoadRunner, QTP, Test director, ClearQuest, Rational Robot? How do you decide which tool will be a best fit for your test enviorment?

3 Answers  


what is the command for identifing the color of the object. please help me ? my numberis 9916800532

3 Answers   TCS,


Hello Friends, I am Looking for the Load runner-Performance testing institute in HYD. I see most of them in this site are suggesting for TS Technologies as best institute for PT load runner. We you pls suggest me, Does this institute offers good coaching on Weekend Sessions/Batches? Does it covers all the course contents in these session? Please help me on this guys..

0 Answers  


how to know whether the user information or any other information which is entered in to the web is storing in secured place or non secured place?

0 Answers  


Could any one share scripts... where we can Parameterize radio buttons and Check boxes in Rational Robot.

0 Answers  


what is meant by keyboard driven test?

3 Answers  


hi every one this is ashok pls any one give answer me pls question is while testing with selenium after giving id user name and password , the inbox will be open , how to handle this one

0 Answers  


When you will not automate testing?

0 Answers  


What kinds of annotations are used in testng?

0 Answers  


Do you know what is the difference between "type" and "typeandwait" command?

0 Answers  


Hi, here r some questions, which were asked in Ekaplus, plz process these questions. 1. How we connect with the version?

0 Answers   Eka Software,


Categories