Java Tutorial for Beginners C02L05 BufferedReader and CSV files
Loading...
826
views
Loading...
Uploader Comments (samblackwell1988)
see all
All Comments (5)
-
In case I want to use a text file to store values for an SQL server connection, (port number, password, SQL server name, etc.), would I be doing just like this and insert the values from the arraylist in the required places? like ds.setServerName("ArrayList.ge
t(0)"); ?
Loading...
@DarthSatoris So if I am reading this right you want to store your values something like this:
9002,myPassword,myServer and then parse this into an array as i have shown you above then use the values to set up a server connection using jdbc? If this is the case then yes you could do it like this. You may also want to have a look at Spring injection which is how I deal with this issue.
samblackwell1988 1 month ago
excuse me , what happens if you didn't close the bufferedreader, in other words if you didnt type br.close ()
fokyoz 2 months ago in playlist Java Programming for the complete beginner using Eclipse
@fokyoz Well I close it because it is good practice to close streams as soon as you are done with them but I have had instances where errors have occurred due to me not closing the stream. In this case the stream being left open is not an efficient use of our resources so closing it releases resources for future use. I advocate people trying these things out if only to experience the pains of not following best practices :)
samblackwell1988 2 months ago