CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14
  1. #1
    Join Date
    Jun 2010
    Location
    Atlanta
    Posts
    9

    [RESOLVED] Trying to Format MySQL Tables JDBC

    Solved.
    Last edited by nargroves; June 3rd, 2011 at 03:20 PM.

  2. #2
    Join Date
    Jun 2010
    Location
    Atlanta
    Posts
    9

    Re: Trying to Format MySQL Tables JDBC

    Solved.
    Last edited by nargroves; June 3rd, 2011 at 03:19 PM.

  3. #3
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Trying to Format MySQL Tables JDBC

    but I can't figure out how to go back and edit the post
    There should be an edit button on the bottom right hand side of the post, but you need to be logged in to see it.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  4. #4
    Join Date
    Jun 2010
    Location
    Atlanta
    Posts
    9

    Re: Trying to Format MySQL Tables JDBC

    Solved.
    Last edited by nargroves; June 3rd, 2011 at 03:19 PM.

  5. #5
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Trying to Format MySQL Tables JDBC

    What I'm trying to do with this class is ...
    Ok so can you give an example of the data you're inputting and explain what the code is actually doing that it shouldn't be ie is it crashing (if it is include the exception dump) or just building the wrong table etc.
    Last edited by keang; June 4th, 2010 at 01:08 PM. Reason: typo
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  6. #6
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Trying to Format MySQL Tables JDBC

    Wow, I could have sworn I looked there...
    You probably did. The site has recently changed and new posters don't appear to get edit rights until their initial post has been moderated.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  7. #7
    Join Date
    Jun 2010
    Location
    Atlanta
    Posts
    9

    Re: Trying to Format MySQL Tables JDBC

    Solved.
    Last edited by nargroves; June 3rd, 2011 at 03:18 PM.

  8. #8
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Trying to Format MySQL Tables JDBC

    I get an ArrayOutOfBoundsException
    So where is the exception stack trace? Please cut and paste the complete stack trace from the console into your next post.

    I don't understand why you are using a LineNumberReader to count all the lines in the file. Don't you just need to read in the next line and parse that and then once the table is created add the data to the table for this line and all subsequent lines until you get to the next table definition. BTW how do you know when you are at the next table definition, presumably there is a marker such as a blank line.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  9. #9
    Join Date
    Jun 2010
    Location
    Atlanta
    Posts
    9

    Re: Trying to Format MySQL Tables JDBC

    Solved.
    Last edited by nargroves; June 3rd, 2011 at 03:18 PM.

  10. #10
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Trying to Format MySQL Tables JDBC

    I would copy and paste the stacktrace, but I'm in Command Prompt haha
    Most command line windows allow you to cut and paste - if you are using Windows right click on the window and select the 'Mark' menu item. Click on the start of the text to select and drag the mouse to the end of the text to select, finally press the enter key. You have now copied the highlighted text.

    Right now, the error is at line 66 and it's a NullPointerException.
    And which line is line No. 66?.

    Nargroves this is starting to get like pulling teeth. Remember the more effort you make in writing your post, the more likely it is that someone will be able to help you.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  11. #11
    Join Date
    Jun 2010
    Location
    Atlanta
    Posts
    9

    Re: Trying to Format MySQL Tables JDBC

    Solved.
    Last edited by nargroves; June 3rd, 2011 at 03:17 PM.

  12. #12
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Trying to Format MySQL Tables JDBC

    You've created an array of type ObjectLayout but you haven't filled it with any ObjectLayout objects hence the null pointer error when you try reference an object at a given index.

    I have to say I am totally confused by your code: why are you iterating over each column and then reading the next line from the file surely this should be the other way around (if there are more columns than lines this will fail) and why are you still using a LineNumberReader why not just use the scanner you already use to read in the first line?
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  13. #13
    Join Date
    Jul 2010
    Posts
    6

    Re: Trying to Format MySQL Tables JDBC

    I think I have the solution of your problem!

    I have worked with a new java pattern named Shine enterprise pattern. It has a package named Jconnection that help you to work with jdbc easier! and another package named util that have a class to help you in sql commands!

    try it!

    you can download it from:

    http://sourceforge.net/projects/shine-enterpris/files/

  14. #14
    Join Date
    Jul 2010
    Posts
    17

    Re: [RESOLVED] Trying to Format MySQL Tables JDBC

    yes my suggestion is jconnection

    it will help you

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured