
I want to pick URLs from excel/CSV file and assign those urls to String variable and use that string variable to open the specified url from browser. I have written code to open browser using selenium libraries. Can you please help me in first part?

Read excel using jdbc:
Follow these steps:
1)Go to the start->Control Panel->Administrative Tools-> data sources.
2)Click Add button and select the Drive do Microsoft Excel(*.xls).
3)After selecting the driver, click finish button.
4)Then give Data Source Name,select drive, directory and excel file to be read and click ok button.
5)Your DSN will get created.
6)Then run the following code:
import java.sql.*;
class GetURLFromExcel{
public static void main(String[] args){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:excel");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from [sheet$]");
String url="";
while (rs.next()){
url+=rs.getString("URL")+" ";
}
String arrURL[]=url.split(" ");
for(int i=0;i<arrURL.length;i++){
System.out.println(arrURL[i]);
}
}
catch(Exception e){
System.out.println(e);
}
}
}

is there any other approach using jxl APIs or so.. because this would be distributed to different users and user may not have access to create the DSN.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.