how to connect client to server using Sockets

how to connect client to server using Sockets

how to connect client to server using Sockets

View Answers

March 28, 2011 at 3:42 PM

/* author K.santhosh kumar-> [email protected]*/

import java.io.FileOutputStream;

import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class ExrelWriter{ public static void main(String[]args){ try{ String filename="c:/hello.xls" ; String rw[][]={{"1","san","kumar","ksankumar","[email protected]","india"}, {"2","palani","kumar","palanikumar","[email protected]","india"}, {"3","raja","pandiyan","rajapandiyan","[email protected]","US"}}; HSSFWorkbook hwb=new HSSFWorkbook(); HSSFSheet sheet = hwb.createSheet("new sheet");

HSSFRow rowhead= sheet.createRow((short)0); rowhead.createCell((short) 0).setCellValue("SNo");

rowhead.createCell((short) 1).setCellValue("First Name"); rowhead.createCell((short) 2).setCellValue("Last Name"); rowhead.createCell((short) 3).setCellValue("Username"); rowhead.createCell((short) 4).setCellValue("E-mail"); rowhead.createCell((short) 5).setCellValue("Country"); for(int i=1;i<3;i++) for(int j=0;j<6;j++){ HSSFRow row= sheet.createRow((short)i);
row.createCell((short) j).setCellValue(rw[i-1][j]);

}

FileOutputStream fileOut = new FileOutputStream(filename); hwb.write(fileOut); fileOut.close(); System.out.println("Your excel file has been generated!");

} catch ( Exception ex ) { System.out.println(ex);

} } }









Related Tutorials/Questions & Answers:
how to connect client to server using Sockets
how to connect client to server using Sockets  how to connect client to server using Sockets
how to connect SQL Server 2005 using php
how to connect SQL Server 2005 using php  i need to connect SQL Server 2005 using php. how can i connect . how to use mssql_connect function
Advertisements
how to send joption panel dialog from server to multipleclients using sockets?
how to send joption panel dialog from server to multipleclients using sockets?  how to send joption panel dialog from server to multipleclients using sockets?like we get a first message with 2 buttonsand on clicking one button we
how to send joption panel dialog from server to multipleclients using sockets?
how to send joption panel dialog from server to multipleclients using sockets?  how to send joption panel dialog from server to multipleclients using sockets?like we get a first message with 2 buttonsand on clicking one button we
how to send joption panel dialog from server to multipleclients using sockets?
how to send joption panel dialog from server to multipleclients using sockets?  how to send joption panel dialog from server to multipleclients using sockets?like we get a first message with 2 buttonsand on clicking one button we
connect sql server 2005 using php
connect sql server 2005 using php  how to connect sql server 2005 using php program. how mssql_connect will work
how to connect to database in php using mysql
how to connect to database in php using mysql  how to connect to database in php using mysql
Server Sockets
that actually implement sockets. It is used to create both client and server... Server Sockets     ... the client side connection and second is server socket, which implement
how to connect j2me program with mysql using servlet?
how to connect j2me program with mysql using servlet?  my program... = response.getWriter(); String userid=connect(user.toLowerCase().trim...); } private String connect(String user,String pwd){ String db
proxy server and client using java - Java Beginners
proxy server and client using java  how to write program in java for proxy server and client
FTP Server : Connect and Login
In this tutorial we will discuss how to connect and login in FTP server with java programming
how to connect the database using hibernet through servlet/jsp through form
how to connect the database using hibernet through servlet/jsp through form  plz give me the reply   Hi Friend, Please visit the following link:ADS_TO_REPLACE_1 http://www.roseindia.net/jsf/myfacesspring
how to connect java with ms access using odbc in eclipse
how to connect java with ms access using odbc in eclipse  import java.sql.*; class AccessDatabase{ public static void main(String[] args){ try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver
Java Connect to and FTP Server
to and FTP Server? How to establish a connection to FTP server in Java? Thansk... the apache commons library to connect/login to FTP server. Link of complete example is FTP Server : Connect and Login. Thanks
How to connect
How to connect  how to connect to a remote host using jsp? We need to update files to the database of the application on the local machine from the updated database on our webpage
Server Sockets
that actually implement sockets. It is used to create both client and server... Server Sockets     ... the client side connection and second is server socket, which implement
ModuleNotFoundError: No module named 'connect-client'
named 'connect-client' How to remove the ModuleNotFoundError: No module named 'connect-client' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'connect-client'  Hi, My
ModuleNotFoundError: No module named 'connect-client'
named 'connect-client' How to remove the ModuleNotFoundError: No module named 'connect-client' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'connect-client'  Hi, My
not able to connect to mysql using.. jdbc
not able to connect to mysql using.. jdbc   i am not able to connect to mysql using jdbc .. is there any classpath that i need to set..because i am using mysql-connector-java jar file..to connect to mysql.. Pls provide the steps
could not connect to the server - JDBC
could not connect to the server  Hii sir, I am working with a JBDC program now. Now i am trying to host it. when i am trying to connect to the remote MySqL server, i got an exception like
How to connect mysql with jsp
How to connect mysql with jsp  how to connect jsp with mysql while using apache tomcat
How to upload files to server using JSP/Servlet?
How to upload files to server using JSP/Servlet?  How to upload files to server using JSP/Servlet
ModuleNotFoundError: No module named 'egenix-mxodbc-connect-server'
: No module named 'egenix-mxodbc-connect-server' How to remove the ModuleNotFoundError: No module named 'egenix-mxodbc-connect-server' error...ModuleNotFoundError: No module named 'egenix-mxodbc-connect-server'  
ModuleNotFoundError: No module named 'egenix-mxodbc-connect-server'
: No module named 'egenix-mxodbc-connect-server' How to remove the ModuleNotFoundError: No module named 'egenix-mxodbc-connect-server' error...ModuleNotFoundError: No module named 'egenix-mxodbc-connect-server'  
ModuleNotFoundError: No module named 'egenix-mxodbc-connect-server'
: No module named 'egenix-mxodbc-connect-server' How to remove the ModuleNotFoundError: No module named 'egenix-mxodbc-connect-server' error...ModuleNotFoundError: No module named 'egenix-mxodbc-connect-server'  
how to connect webcam in html
how to connect webcam in html  how to connect webcam in html.emphasized text
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql  i am working on a project on deadlock in distributed transactions , and in that i am using my sql in java i need
How to connect with database
How to connect with database  jdbc connection
ModuleNotFoundError: No module named 'egenix-mxodbc-connect-client'
: No module named 'egenix-mxodbc-connect-client' How to remove the ModuleNotFoundError: No module named 'egenix-mxodbc-connect-client' error...ModuleNotFoundError: No module named 'egenix-mxodbc-connect-client'  
ModuleNotFoundError: No module named 'lets-connect-client'
named 'lets-connect-client' How to remove the ModuleNotFoundError: No module named 'lets-connect-client' error? Thanks   Hi...ModuleNotFoundError: No module named 'lets-connect-client'  Hi, My
ModuleNotFoundError: No module named 'total-connect-client'
: No module named 'total-connect-client' How to remove the ModuleNotFoundError: No module named 'total-connect-client' error? Thanks   Hi...ModuleNotFoundError: No module named 'total-connect-client'  Hi
ModuleNotFoundError: No module named 'lets-connect-client'
named 'lets-connect-client' How to remove the ModuleNotFoundError: No module named 'lets-connect-client' error? Thanks   Hi...ModuleNotFoundError: No module named 'lets-connect-client'  Hi, My
ModuleNotFoundError: No module named 'mdf-connect-client'
named 'mdf-connect-client' How to remove the ModuleNotFoundError: No module named 'mdf-connect-client' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'mdf-connect-client'  Hi, My
ModuleNotFoundError: No module named 'stitch_connect_client'
: No module named 'stitch_connect_client' How to remove the ModuleNotFoundError: No module named 'stitch_connect_client' error? Thanks   Hi...ModuleNotFoundError: No module named 'stitch_connect_client'  Hi
ModuleNotFoundError: No module named 'egenix-mxodbc-connect-client'
: No module named 'egenix-mxodbc-connect-client' How to remove the ModuleNotFoundError: No module named 'egenix-mxodbc-connect-client' error...ModuleNotFoundError: No module named 'egenix-mxodbc-connect-client'  
ModuleNotFoundError: No module named 'harmony-connect-client'
: No module named 'harmony-connect-client' How to remove the ModuleNotFoundError: No module named 'harmony-connect-client' error? Thanks   Hi...ModuleNotFoundError: No module named 'harmony-connect-client'  Hi
unable to connect to server - JSP-Servlet
unable to connect to server  thank you for the program code... in weblogic/apache servers can any one help me how to do this ?   Hi Friend...-application-server/tomcat/install-configure.shtml Here you will get step by step
How to connect to MySQL in JSP?
How to connect to MySQL in JSP?  How to connect to MySQL in JSP..., You can use the Java JDBC code to connect to MySQL database in JSP page. Check the tutorial: Connect JSP with mysql Thanks
how to copy the directory in to ftp server using java
how to copy the directory in to ftp server using java  how to copy the directory in to ftp server using java ?   Hello venaktehs As much as I know,You can do this as follows:ADS_TO_REPLACE_1 First,Create a directory
Connecting to remote mysql server using jdbc.
Connecting to remote mysql server using jdbc.  How to Connect to remote mysql server using jdbc
can't connect to MySQL Server(10060) - JDBC
created a DB in the Hosting MySQL server and now i want to create a table By using MySQL front end. Can we connect to the MySQL server using the I.P address...can't connect to MySQL Server(10060)  Hii Sir, I am working
how i connect two page
how i connect two page  strong textlink text
how to connect jdbc
how to connect jdbc  package com.tcs.ilp.Try.Controller; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import
How to perform CRUD operations using gwt on Restlet server 2.0
How to perform CRUD operations using gwt on Restlet server 2.0  I want to perform CRUD operation using gwt on restlet server 2.0. The CRUD operations are like create, read, update, delete operations.Any generic code
Am using windows xp os..how to install wamp server for this os ?
Am using windows xp os..how to install wamp server for this os ?  i installed wamp server . i was put my wampserver is online.. but i cant open phpmyadmin in my browser. i dont know the reason.. pls anyone tel what i did wrong
how to connect program to database
how to connect program to database  Sir i want ur help in my program. I want to save the data in the database. When i'll click on save button the entered data must be save in the database. I want an action performed method
How to connect on screen keyboard to system.
How to connect on screen keyboard to system.  How to connect on screen keyboard to system.I made on screen keyboard in java(swing).Now i want connect to system means when i pressed any button then it type on notepad or any
How to connect on screen keyboard to system.
How to connect on screen keyboard to system.  How to connect on screen keyboard to system.I made on screen keyboard in java(swing).Now i want connect to system means when i pressed any button then it type on notepad or any
How to implement FTP using java
client and FTP server. Could anyone help me for How to implement FTP using java...How to implement FTP using java  Hi, I am a B.tech student and I... tutorials with example code FTP Server : Connect and Login Apache FTP Server FTP
how to allow or stop using internet - Java Server Faces Questions
how to allow or stop using internet  hello this is my first qusetion I am developing a cybercafe management tool in java,the problem is how to allow or stop the users of cafe using internet by the administrator on other

Ads