import java.util.regex.Pattern;
import java.sql.*;
import javax.sql.*;
import java.io.*;
public class contact extends SeleneseTestCase
{
public void setUp() throws Exception
{
// add details of browser & other details
}
public void testContact() throws Exception {
System.out.println("Connecting to the database");
String url="jdbc:mysql://localhost:
Class driverClass = Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection(url,"
System.out.println("Connected to the database");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from emp_account");
ResultSetMetaData rsmd = rs.getMetaData();
int columns = rsmd.getColumnCount
while (rs.next())
for (int i = 1; i < columns; i++)
{
System.out.print(rs.getObject(i + 1)+" |");
}
System.out.println(" ");
}
}}
No comments:
Post a Comment