Solved.
Printable View
Solved.
Solved.
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.Quote:
but I can't figure out how to go back and edit the post
Solved.
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.Quote:
What I'm trying to do with this class is ...
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.Quote:
Wow, I could have sworn I looked there...
Solved.
So where is the exception stack trace? Please cut and paste the complete stack trace from the console into your next post.Quote:
I get an ArrayOutOfBoundsException
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.
Solved.
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.Quote:
I would copy and paste the stacktrace, but I'm in Command Prompt haha
And which line is line No. 66?.Quote:
Right now, the error is at line 66 and it's a NullPointerException.
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.
Solved.
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?
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/
yes my suggestion is jconnection
it will help you