如何在服务器上运行Java程序? [英] How to run a java program on a server?

查看:1310
本文介绍了如何在服务器上运行Java程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经制作了一个Java应用程序,用于将数据从.csv文件存储到MySql数据库中.现在,我的客户希望它将此应用程序上载到他的网站空间(他为网站占用的网站空间),以便他可以在该服务器上运行该程序.

I have made a java application that stores data from a .csv file to a MySql database. Now my client want it to upload this application to his web space (web space he has taken for his website) so that he can run that program on that server.

我已经使用FileZilla软件将该程序上传到他的虚拟主机,但是现在我不知道如何在他的服务器上运行该程序.

I have used FileZilla software to upload the program to his web hosting but now I don't know how to run that program on his server.

要在本地系统上运行它,它需要打开一个命令提示符窗口来运行它.

To run it on localsystem, it needs to open a command-prompt window to run it.

网络托管运行该Java程序是否必须支持任何特定功能?

Is there any specific feature that the web-hosting must support to run that java program?

由于它将数据(.csv文件)中的数据存储到MySql数据库中,那么是否最好在托管数据库的服务器上而不是托管网站的服务器上部署该程序?

As it stores data from a file (.csv file) to a MySql database, then would it better to deploy that program on the server on which the database is being hosted instead of the server on which the website is being hosted?

推荐答案

实际上是指"Web应用程序",我们通常是指一个特殊的应用程序,该应用程序被编程为始终在Web服务器上运行,只是等待来自服务器的请求.用户来处理.

Indeed, saying "web-application", we usually mean a special application, programmed to run on the web-server all the time, just waiting for requests from user to process.

就您而言,您有一个基于控制台的应用程序.

In your case, you have a console-based application.

根据服务器的配置,这些应用程序中的任何一个都不能在您的客户端虚拟主机上运行,​​或者它们中的任何一个都可以运行.

Depending on the configuration of the server, no of these applications could be run on your client web-hosting, any of them or both.

由于通常由托管公司提供网络托管,因此他们可能已准备好运行您的应用程序的配置,可能已打开/关闭它,甚至为此花了钱.

Since, usually web-hosting is provided by hosting company, they may have configurations ready for running your applications, may have it turnable on/off or even take money for this.

如果是内部公司服务器,则需要询问客户及其IT部门以进行配置.

In case of internal company server, you need to ask your customer and its IT-stuff to configure this.

最后,您需要问: 1.服务器是否支持SSH? -它只是一个远程控制台.通常它在端口22上运行,您可以使用命令"telnet 您的服务器 22"(Windows和Linux)对其进行检查-如果它不拒绝您的连接-则表示已配置SSH. 2.您的服务器是否安装了Java,并且是否可以通过SSH连接将其用于您的帐户?

Finally, you'll need to ask: 1. Does server support SSH? - it's simply a remote console. Usually it's running at port 22 and you many check it with command "telnet yourserver 22" (windows and linux) - if it doesn't reject your connect - means SSH is configured. 2. Does your server have java installed and if it is available for your account via SSH connection?

  1. 仅当客户真正指的是Web应用程序而不是基于控制台的应用程序时,才需要询问服务器是否具有Java的Web应用程序服务器-通常,它类似于Apache Tomcat,Jetty,JBoss,Weblogic等.但是这种方式需要修改应用程序才能在网络服务器中运行.

如果您决定使用控制台应用程序而不是将其升级"到Web应用程序,则确实可以在数据库正在运行的主机上运行它(同样,您将需要SSH).您将节省远程数据库访问操作的时间-从理论上讲,您的程序将运行得更快.

If you will decide to use console-application and not "upgrade" it to web-application, you really may run it at the host your database is running (again, you'll need SSH). You'll save time on remote database access operations - theoretically, your program will work faster.

这篇关于如何在服务器上运行Java程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆