In selenium testing how to connect with database , any one
pls give the entire information
Answers were Sorted based on User's Feedback
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 |
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 |
What automated tools are you familiar with?
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?
what is the command for identifing the color of the object. please help me ? my numberis 9916800532
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..
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?
Could any one share scripts... where we can Parameterize radio buttons and Check boxes in Rational Robot.
what is meant by keyboard driven test?
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
When you will not automate testing?
What kinds of annotations are used in testng?
Do you know what is the difference between "type" and "typeandwait" command?
Hi, here r some questions, which were asked in Ekaplus, plz process these questions. 1. How we connect with the version?