|
-
June 4th, 2010, 12:31 PM
#1
[RESOLVED] Trying to Format MySQL Tables JDBC
Last edited by nargroves; June 3rd, 2011 at 03:20 PM.
-
June 4th, 2010, 12:38 PM
#2
Re: Trying to Format MySQL Tables JDBC
Last edited by nargroves; June 3rd, 2011 at 03:19 PM.
-
June 4th, 2010, 12:53 PM
#3
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.
-
June 4th, 2010, 01:01 PM
#4
Re: Trying to Format MySQL Tables JDBC
Last edited by nargroves; June 3rd, 2011 at 03:19 PM.
-
June 4th, 2010, 01:03 PM
#5
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
-
June 4th, 2010, 01:07 PM
#6
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.
-
June 4th, 2010, 01:12 PM
#7
Re: Trying to Format MySQL Tables JDBC
Last edited by nargroves; June 3rd, 2011 at 03:18 PM.
-
June 5th, 2010, 04:01 AM
#8
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.
-
June 7th, 2010, 10:04 AM
#9
Re: Trying to Format MySQL Tables JDBC
Last edited by nargroves; June 3rd, 2011 at 03:18 PM.
-
June 7th, 2010, 10:27 AM
#10
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.
-
June 7th, 2010, 10:42 AM
#11
Re: Trying to Format MySQL Tables JDBC
Last edited by nargroves; June 3rd, 2011 at 03:17 PM.
-
June 7th, 2010, 11:40 AM
#12
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?
-
July 3rd, 2010, 04:57 PM
#13
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/
-
July 12th, 2010, 02:05 PM
#14
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|