Click to See Complete Forum and Search --> : [RESOLVED] Trying to Format MySQL Tables JDBC


nargroves
June 4th, 2010, 12:31 PM
Solved.

nargroves
June 4th, 2010, 12:38 PM
Solved.

keang
June 4th, 2010, 12:53 PM
but I can't figure out how to go back and edit the postThere should be an edit button on the bottom right hand side of the post, but you need to be logged in to see it.

nargroves
June 4th, 2010, 01:01 PM
Solved.

keang
June 4th, 2010, 01:03 PM
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.

keang
June 4th, 2010, 01:07 PM
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.

nargroves
June 4th, 2010, 01:12 PM
Solved.

keang
June 5th, 2010, 04:01 AM
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.

nargroves
June 7th, 2010, 10:04 AM
Solved.

keang
June 7th, 2010, 10:27 AM
I would copy and paste the stacktrace, but I'm in Command Prompt hahaMost 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.

nargroves
June 7th, 2010, 10:42 AM
Solved.

keang
June 7th, 2010, 11:40 AM
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?

moyow
July 3rd, 2010, 04:57 PM
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/

OMID128
July 12th, 2010, 02:05 PM
yes my suggestion is jconnection

it will help you