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 |
How do you decide which tool you have to use?
What are the types of framework used in software automation testing ?
What is the difference between automation tools and management tools?
all clients are using at once if any problem raise?
How to decide the tool that one should use for automation testing in their projects?
i am looking for HP QTP automated testing software, do you offers reselling this software or should i directly purchase with HP
what is meant by keyboard driven test?
HOW CAN WINRUNNER AND TEST DIRECTOR CONNECTED TO THE DATABASE AND WHAT R THE OPTIONS?
Kindly let me know how to setup JMeter for functionality testing of a Web application.. The apache help doc is good but i m little confused with it... :(
Write a query to find second highest salary of an employee.
72 Answers ABC, Cognizant, MegaSoft, Netwin Infosolutions, Nippon, Polaris, Satyam, SGS, TCS, Verisoft,
What testing activities you may want to automate?
How can the user get a text of a web element?