0

I did this ..

String filename = "tempoutfile.txt";
 String tablename = "table1";

	try{
			
	
		
			Connection con = DriverManager.getConnection("jdbc:mysql://localhost/Test","root","");
			Statement s=con.createStatement();
			ResultSet r=s.executeQuery("SELECT * INTO OUTFILE '"+ filename + "' FROM " + tablename);

			
			
			
		
			}catch(SQLException se){System.out.println(se.getMessage());}

But I can't find the file that is created!!

When I run the query in WAMP mysql console , it creates the out file in wamp\mysql\data . But not in previous case.

Where is this file created?

Edited by jrosh: n/a

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by masijade
0

Add a System.out.println(System.getProperty("user.dir")) in there.

Otherwise use the search function for the OS.

But, the best way is to provide the full path to the file from the beginning. Why simply deal with defaults that can change due to configuration and/or operating parameters when you can control the operation.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.