Appium is limited to testing your mobile applications. To use Appium for Database Testing you need to use
the JDBC ("Java Database Connectivity").JDBC (Java Database
Connectivity) is a SQL level API which allows you to execute SQL queries using java code . JDBC is used for enabling connectivity between the Java
Programming language and a wide range of databases.
To test with database we need to learn how to connect with database first then how to execute queries followed by how to process the results.
Video Tutorial -
1. Connect to Database -
In order to make a connection to the database the syntax is as per given below and after connection setup you also need to load the JDBC Driver.Connection con = DriverManager.getConnection(dbUrl,username,password); Class.forName("com.mysql.jdbc.Driver");
Where,
- Userid is the username configured in the database
- Password of the configured user
- URL is of format jdbc:< dbtype>://ipaddress:portnumber/db_name"
2. Execute Queries -
Once connection is made, you need to execute queries.You can use the Statement Object to send queries. First Create Statement and once the statement object is created use the executeQuery method to execute the SQL queries.
Statement stmt = con.createStatement();
ResultSet rs=stmt.executeQuery(select * from employee);
Statement stmt = con.createStatement(); ResultSet rs=stmt.executeQuery(select * from employee);
3. Process Results -
As in above example we have seen that after query execution the result is stored in ResultSet Object. with this class object we can perform loads of actions to process an test the results as per our requirement.
- String getString() - get the string type data from ResultSet.
- int getInt() - get the integer type data from ResultSet.
- double getDouble() - get the double type data from ResultSet.
- Date getDate() - get the date type data from ResultSet.
- boolean next() - move to next record in the ResultSet.
- boolean previous() - move to previous record in the ResultSet.
- boolean first() - move to first record in the ResultSet.
- boolean last() - move to last record in the ResultSet.
- boolean absolute(int rowNumber) - move to perticular record in the ResultSet.
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Core Java Training in Chennai Core Java Training in Chennai
Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai
IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.
DeleteIEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.
corporate training in chennai corporate training in chennai
corporate training companies in india corporate training companies in india
corporate training companies in chennai corporate training companies in chennai
I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai
This comment has been removed by the author.
ReplyDeleteYour good knowledge and kindness in playing with all the pieces were
ReplyDeletevery useful. I don’t know what I would have done if I had not
encountered such a step like this.
java training in chennai
java Training in Bangalore
I think this is the best article today. Thanks for taking your own time to discuss this topic, I feel happy about that curiosity has increased to learn more about this topic. Keep sharing your information regularly for my future reference.
ReplyDeleteJava Courses in chennai
Excellent blog! The content is so strong and informative.Thanks for sharing such useful post.
ReplyDeleteJava training in Chennai
Great idea, It was valuable info and very impressed to me. I always appreciate your blog and a long time after I saw a wonderful post. Thank you...!
ReplyDeleteTOEFL Coaching in Chennai
TOEFL Training in Chennai
IELTS Coaching in Chennai
Jmeter Training in Chennai
Spoken English Classes in Chennai
Ethical Hacking Course in Chennai
TOEFL Coaching in OMR
TOEFL Coaching in Tambaram
This is an awesome post.Really very informative and creative contents.
ReplyDeleteWordpress Development company in Chennai
TreasureBox is operated by a group of young, passionate, and ambitious people that are working diligently towards the same goal - make your every dollar count, as we believe you deserve something better.
ReplyDeletebike stand nz
sofa bed nz
gazebo nz
Good Information to all.
ReplyDeletemedical coding course in chennai
medical coding in chennai
Aviation Academy in Chennai
Best Aviation Academy in Chennai
CIC Training institute in Chennai
CIC Coaching Center in Chennai
medical coding coaching center in chennai
medical coding training fees in chennai
merriage anniversary wishes for husband
ReplyDeleteI read this article, it is really informative one. Your way of writing and making things clear is very impressive. Thanking you for such an informative article.minecraft coding course
ReplyDelete