Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Multiple url handling

Have Programming Question? Ask it here!
 
 
 


Dhananjay
Multiple url handling
2 Answer(s)      3 years and 5 months ago
Posted in : Java Beginners


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?


Advertisement
View Answers

March 3, 2011 at 5:26 PM


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);
        }
    }
}


March 11, 2011 at 10:58 AM


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.



Related Tutorials/Questions & Answers:
Multiple url handling
Multiple url handling  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
Handling multiple buttons in HTML Form
Handling multiple buttons in HTML Form  How to handle Handling multiple buttons in HTML Form
Advertisements
Handling multiple combo boxes of same name - IDE Questions
Handling multiple combo boxes of same name  my code is like this.. i'm displaying two combos of same id.. on the browser..if user wants he can
Exception Handling : Multiple Catch
Exception Handling : Multiple Catch In this tutorial, we will discuss the use of declaring multiple catch  with the try block. Multiple Catch : A try statement can have multiple catch blocks. Through multiple catch
URL Encoding and URL Decoding
URL Encoding and URL Decoding  What is URL Encoding and URL Decoding ?   URL encoding is the method of replacing all the spaces and other extra characters into their corresponding Hex Characters and Decoding
Friendly URl
Friendly URl  creating a SEO friendly URL
Struts2.2.1 handle multiple Submits in your application
Struts2.2.1  handle multiple Submits in your application  In this tutorial, We will discuss about the handling the multiple submits... at a time and other can not aquired and on multiple submit generates error
URL problem
URL problem  Hi. I have created a webpage for my project website. in that i have used frameset to split the page. Now if i click any link in the page its navigating to the another page. but the problem is here in the url its
exception handling
exception handling  explain about exception handling
hide url
hide url  how i can hide url i have lot of jsp pages when i call one jsp in address another jsp page name also displayed in the address bar? url not visible to endusers please tell me any answer what i should do
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
exception handling
exception handling  what is the information of exception handling?   Have a look at the following link: Java Exception Handling
Assigning URL
url to my attendancetemplate.jsp file, please help me if anyone knows, am
event handling
event handling  diff btwn event handling in ASP.net and in HTML
Handling Multiple Catch Clauses
Handling Multiple Catch Clauses   ... block.In java when we handle the exceptions then we can have multiple catch blocks... of multiple catch blocks for a single try block.  
exception handling
exception handling  could you please tell me detail the concept of exception handling
php download file from url
php download file from url  how to download multiple files in PHP using the URL's
exception handling
exception handling   Give the exception hierarchy of Java.   Please visit the following links: http://www.roseindia.net/java/java-exception/exception-java.shtml http://www.roseindia.net/java/exceptions/exception
exception handling
exception handling  What is an exception and what are the advantages of exception handling mechanism.   Java Exception Exception... the working code and the error-handling code can be disintegrated. It also gives us
AdminStrator handling
AdminStrator handling  Hi...Deepak,I want code for adminstrator like adminstrator can handle multiple clients i.e. if adminstrator is adding any file then making it available for all the clients.How to make this availability
long url to short url for jsp or servlet
long url to short url for jsp or servlet  I have to convert a url "http://localhost:8080/Popup/popup?phone=111111111". I am unable to do the same. Please any help
fetch url in php - PHP
fetch url in php  How to Fetch URL in PHP
handling Button Event in iphone
handling Button Event in iphone  handling Button Event in iphone
error handling mechanism
error handling mechanism  What is Java error handling mechanism
javascript for websites url validation
javascript for websites url validation  javascript for websites url validation   JavaScript Code for URL Validation **function isvalidurl(url) { return url.match(/^(ht|f)tps?:\/\/[a-z0-9-.]+.[a-z]{2,4}\/?([^\s<
multiple inheritance.
multiple inheritance.  hello, can java support multiple inheritance???   hi, java does not support multiple inheritance
parse url iphone sdk
parse url iphone sdk  How can i parse two different URL's using NSXMLParser
uiwebview open url in safari
uiwebview open url in safari  How to open outgoing URL like ffacebook or twitter in iPhone/iPad
UIWebview load url
UIWebview load url  How to load website url in UIWebview? Tell me code for UIWebview load url of a website Thanks...://www.roseindia.net"]; // Load URL //Create a URL object. NSURL *url = [NSURL
java referer url
java referer url  How to get the referer url in Java? Thanks
Load UIImage from URL
Load UIImage from URL  Load UIImage from URL
Mask actual URL
Mask actual URL  How to mask actual URL to the JSF page
javascript regex validate url
javascript regex validate url  How to validate URL in regex Javascript   <html> <head> <title>Url validation using...() { var url = document.getElementById("url").value; var pattern
URL CODE OF BUTTONS
URL CODE OF BUTTONS   how to create a button tag, i need a details for creating a button tag with url code
Creating URL in java
Creating URL in java  Hii to all I m trying to create a url using... Url { /** * @param args */ public static void main(String... a url object by specifing each parameter separately, including
JSP URL Encoding
JSP URL Encoding          JSP URL Encoding is used to encode the url in JSP. URL Encoding is the process of converting string into valid URL format
change url string
change url string  How can i change the login parameter in url after login.That parameter which i were entered will not be shown on url it will be changed after login.I want this.I know it is possible but tell me the way
PHP Displaying URL Content
PHP Displaying URL Content  In my PHP application form, on submitting the form details it always displaying url content. Can anyone tell me what is the reason and how to restrict it from displaying
avoid using the whole URL
avoid using the whole URL  How can I avoid using the whole URL
php parse string for url
php parse string for url  Do i need a regex to parse a URL-type string in PHP
Event handling on an image
Event handling on an image  I want to divide an image into frames and want to do event handling on the frames
Exception Handling in Struts.
Exception Handling in Struts.  How you can do Exception Handling in Struts
 

 

 

DMCA.com