how to connect client to server using Sockets

Ads

 
 

Share on Google+Share on Google+

giridhar gangapatnam
how to connect client to server using Sockets
1 Answer(s)      6 years and 2 months ago
Posted in : Java Beginners

how to connect client to server using Sockets

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

} } }


Ads









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 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
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 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
Server Sockets
that actually implement sockets. It is used to create both client and server sockets... Server Sockets     ... the client side connection and second is server socket, which implement
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
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
Server Sockets
that actually implement sockets. It is used to create both client and server sockets... Server Sockets     ... the client side connection and second is server socket, which implement
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
How to install MySQL Server and Client on Ubuntu 16.04?
How to install MySQL Server and Client on Ubuntu 16.04?  Hi, Latest... MySQL Server and Client on Ubuntu 16.04? Let's know the steps and command... install mysql-server mysql-client Here is the full output of the process: To run
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 j2me program with mysql using servlet?
how to connect j2me program with mysql using servlet?  my program...(); String userid=connect(user.toLowerCase().trim(), pwd.toLowerCase().trim... String connect(String user,String pwd){ String db="mobileapp
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 use a JInternalFrame in a JFrame to create a chat window in a client/server app?
how to use a JInternalFrame in a JFrame to create a chat window in a client/server app?  how to use a JInternalFrame within a JFrame? i want to create a client/server app. i know that JIternalFrame should be used
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
Client Server Java app
Client Server Java app  I developed a client server based java networking Instant Messaging app. The client program is needed to be run on the client computer whereas the server program is on server computer. This works in my
File transfer from client to server - Java Beginners
File transfer from client to server  hi,, I've been trying to make an application where the user select a file using JFileChooser and then the program directly send it to the server using client/server sockets, I've tried
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
server client comms
server client comms  i am trying to return frame through server client comms anyone can help me about that i want to return a class to client side but my class defined in server side
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: http://www.roseindia.net/jsf/myfacesspring/loginRegistration.shtml Hope
Server calling of .exe file in the client
Server calling of .exe file in the client   I have a requirement with java webapplication. We are using jboss as appserver on Linux machine. How can I call a .exe file from client machine? I want to run .exe from webpage like
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
How to connect mysql with jsp
How to connect mysql with jsp  how to connect jsp with mysql while using apache tomcat
tcp client server communication
tcp client server communication  i am not been able to find the error in the program server: import java.io.*; import java.net.*; public class Server { public static void main(String[] args) throws Exception
how to perform the client side validations to the dropdown list using javascript?
how to perform the client side validations to the dropdown list using javascript?  Hi Good Morning! This is Prasad, I want to perform the client side validation to the dropdown list using javascript. So give me sample.I am
Client-Server Architecture
Client-Server Architecture       Client-server architecture can be considered...; and a client machine where server has some resources that can be shared by different
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 webcam in html
how to connect webcam in html  how to connect webcam in html.emphasized text
How to connect with database
How to connect with database  jdbc connection
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
Tutorials   
Java Spring Hibernate Struts Training What type of programming language is Java? How do beginners learn about Java? ClassNotFoundException HttpRequestInterceptor java.lang.noclassdeffounderror: org/apache/http/httprequest noclassdeffounderror: org/apache/http/client/methods/httpurirequest java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient How do I resolve this Java Class not found exception? httpclient java.lang.NoClassDefFoundError Apache Commons ioutils maven dependency Read/Convert an inputStream to a String What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017

Ads

 
Advertisement null

Ads