Back To Normal

Subscribe To Our E-Mail Newsletter

Wednesday, September 26, 2012

Top Five Testing Blogs

I have found top five testing blogs for software testing . This blogs are really useful for software tester who want to know or practice new concepts .

James Bach  : http://www.satisfice.com/blog/

Agile : http://agiletesting.blogspot.in/

Martin Fowler : http://martinfowler.com/

Tester Tested : http://testertested.blogspot.in/

Test This blog : http://www.testthisblog.com/

Some useful Top 100 list will be listed in below urls.

http://www.testingminded.com/2010/04/top-100-software-testing-blogs.html

Read More


Connecting Excel as Database in java

User can connect excel as database by using excel drivers and perform insert , read operations.
import java.io.*;
import java.sql.*;

public class ExcelReadTest{

public static void main(String[] args){

Connection connection = null;

try{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con = DriverManager.getConnection( "jdbc:odbc:exceltest" );

Statement st = con.createStatement();

ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );

ResultSetMetaData rsmd = rs.getMetaData();

int numberOfColumns = rsmd.getColumnCount();

while (rs.next()) {

for (int i = 1; i <= numberOfColumns; i++) {

if (i > 1) System.out.print(", ");

String columnValue = rs.getString(i);

System.out.print(columnValue);

}

System.out.println("");

}
st.close();

con.close();

} catch(Exception ex) {

System.err.print("Exception: ");

System.err.println(ex.getMessage());

}

}

}
To insert data :
"insert into [Sheet1$] (ColumnName1,ColumnName2) values ('"+sValue1+"','"sValue2"')"
Read More


Tuesday, September 25, 2012

How to read Excel data by using POI jars

Public List ReadExcel2010(String sFilename)


{

List SheetData = new ArrayList();

InputStream fs = new FileInputStream(filename);

XSSFWorkbook wb = new XSSFWorkbook(fs);

XSSFSheet sheet = wb.getSheetAt(0);

try

{

Header header = sheet.getHeader();
int rowsCount = sheet.getLastRowNum();

System.out.println("Total Number of Rows: " + (rowsCount + 1));

for (int i = 0; i <= rowsCount; i++) {

List data = new ArrayList();

Row row = sheet.getRow(i);

int colCounts = row.getLastCellNum();

System.out.println("Total Number of Cols: " + colCounts);

for (int j = 0; j < colCounts; j++) {

Cell cell = row.getCell(j);

data.add(cell );

System.out.println("[" + i + "," + j + "]=" + cell.getStringCellValue());

}

Sheetdata.add(data);

}
} catch (Exception ex) {

java.util.logging.Logger.getLogger(FieldController.class.getName()).log(Level.SEVERE, null, ex);

} finally {

try {

fs.close();

} catch (IOException ex) {

java.util.logging.Logger.getLogger(FieldController.class.getName()).log(Level.SEVERE, null, ex);

}

}
return Sheetdata;

}
Read More


560 Free Online Courses

Top 200 universities launched 500 free online courses.  Please find the list here .