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 is Database Testing?
Please explain how to perform load-testing?
Can test automation improve test effectiveness?
What types of documents would you need for QA, QC, and Testing?
Could anybody send me the document on how to re install QTP 9.0 after the evalution period (14 days). It will expire within 3 days. Thabks in advance.
How can you switch back from a frame?
What are the important modules of an automation testing framework?
Explain me how do you send enter/tab keys in webdriver?
Tell me how could the web element attributes be inspected in order to use them in different locators?
Where do we get the QTP and Load runner softwares CDs ( Original ) in chennai
notice the distinction between data driven testing and retesting?
How will you choose a tool for test automation?