Results 1 to 10 of 10
- 09-01-2009, 04:03 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 51
- Rep Power
- 0
Accessing local file from server side using Java Application
Hi
I want to write a code that will access the local file from the server side using Java Application. I have my java code running as a server and I want to access the file located in the local system which is connected with the server where my java code is running.
Thanks
Sachin
- 09-01-2009, 04:08 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
What kind of client/server application do you have?
Is it a web application or are you serving a Java application via webstart e.t.c?
Why did you post this in the databases forum?
- 09-01-2009, 04:15 PM #3
Member
- Join Date
- Aug 2009
- Posts
- 51
- Rep Power
- 0
Hi r035198x
I know I did that by mistake putting this post under database. But I was told that it is related with ODBC so i thought may be this is the best tittle. I have a java program running on my company's server. It is not a client-server model but just a simple java program that has to run 24x7 coz it extracts data from the website. Now i have access a file located in the local system which is connected with this server.
Thanks
- 09-01-2009, 04:22 PM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
How is the client computer connected to the server? Are the two computers on the same network and are able to communicate with each other say, via ssh, ftp?
- 09-01-2009, 04:35 PM #5
Member
- Join Date
- Aug 2009
- Posts
- 51
- Rep Power
- 0
The two computers are on same network I guess. I can let you know that once i talk to the system admin. But can I coonect to that system by using the IP Address of the system and access those files.
Thanks
- 09-01-2009, 04:43 PM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Copying a file over the network then? The code has been written lots of times.
Google will point to an assortment.
- 09-01-2009, 04:47 PM #7
Member
- Join Date
- Aug 2009
- Posts
- 51
- Rep Power
- 0
The thing is that I have to establish a connection with that machine and for that I have written:
url = "jdbc:odbc:10.1.0.207";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection (url, "administrator", "meri");
10.1.0.207 being the IP address of that machine.
but it gives me null pointer exception.
I really appreciate your help. Thanks
- 09-01-2009, 06:52 PM #8
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Why are you using JDBC at all?
You are not trying to get data from the database, you are just trying to copy a file over the network, right?
- 09-01-2009, 07:00 PM #9
Member
- Join Date
- Aug 2009
- Posts
- 51
- Rep Power
- 0
Yes you are right.
I have made slight changes to my code:
url2 = new URL("http","10.1.0.120","C:/password.txt");
URLC = url2.openConnection();
filein = URLC.getInputStream();
This is what i am using. But it is giving me an exception filenotfound even though the file is there.
- 09-01-2009, 07:17 PM #10
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Similar Threads
-
updating server side file using java bean
By tskarthic in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 04-30-2009, 02:53 PM -
How to open a file located in server from client side
By Malathi in forum Web FrameworksReplies: 4Last Post: 04-20-2009, 09:10 PM -
How to connect to Window based file server from a Java Application
By anupbkk in forum Advanced JavaReplies: 2Last Post: 04-06-2009, 05:52 PM -
How can i retain special characters in server side (java) after passing from client
By Malathi in forum Web FrameworksReplies: 1Last Post: 03-27-2009, 10:18 AM -
Copy a .swf file from server side to client using signed applet
By Imoracle in forum Java AppletsReplies: 2Last Post: 10-05-2008, 06:13 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks