Results 1 to 4 of 4
Like Tree2Likes
  • 1 Post By SurfMan
  • 1 Post By SurfMan

Thread: How to read text file first line and save into sqlserver database?

  1. #1
    athar is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default How to read text file first line and save into sqlserver database?

    Hi
    I have a text file in c: and i want to read first line from the file and save into sql server database using java? I am new to java, i appreciate line by line explanation.
    Here is my connection string : jdbc:sqlserver://XXX02:1433;databaseName=PSroll;user=12345;password =12345;

    Thanks in advance

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,087
    Rep Power
    4

    Default Re: How to read text file first line and save into sqlserver database?

    Split this in to sub-problems:
    1) how do I read lines from a file
    2) how do I connect to a database
    3) how do I insert data into a database

    Combine 1-2-3 to get your result.

    Don't expect your code to be written for you here. As Darryl Burke says: "This is a forum, not a code factory" ™
    Tolls likes this.

  3. #3
    athar is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default Re: How to read text file first line and save into sqlserver database?

    Hi
    I wish, as a programmer, i could write the code for the user who post the same kind of question.
    Anyway i split this into sub problems
    Thanks

  4. #4
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,087
    Rep Power
    4

    Default Re: How to read text file first line and save into sqlserver database?

    Well, I *am* a programmer, and I know that I earn my money by programming for others, being my boss and clients. So if you pay me, I will program it for you. Otherwise, I will happily donate my spare, and free (as in beer), time, to answer your questions about the code that *you* write.

    All three subproblems are highly documented on the interwebs, so you should have no problem finding an answer for all three. If you run into a problem please post them here, and we all will look into it.
    PhHein likes this.

Similar Threads

  1. Replies: 4
    Last Post: 05-27-2011, 05:13 PM
  2. Replies: 12
    Last Post: 04-22-2011, 12:17 AM
  3. Replies: 1
    Last Post: 02-13-2011, 04:09 PM
  4. Replies: 14
    Last Post: 12-07-2010, 11:41 AM
  5. Replies: 4
    Last Post: 09-10-2009, 11:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •