Click to See Complete Forum and Search --> : recieving error


keko2005
11-28-2005, 07:56 PM
hey guys, im a noob rememebr that. ok i am designing an application that connects to a db, now i got the connection working properly. when i run my driver, which brings up a test GUI to input column name, type length and null. and everything is inputed, click ok and i recieve this error when trying to execute the sql statement

Communication link failure: java.io.EOFException, underlying cause: null

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

the method that puts it all together from the GUI fields, is in a seperate class. it appends the appropriate fields(not blank ones), and then passes the string rep of the characters(toString) to a createTables method. everything in the create tables method executes until i reach this line of code:

stmt.execute(sqlStr);

thats when i get the error. but its weird, because if i create the statement myself:

String str = "CREATE TABLE test(testField char(8));
etc...
stmt.execute(str);

it works fine, its only when im recieving the SQL string from another class that i encounter this error. do you guys understand, or do you need me to post the code?

Waylander
11-28-2005, 10:33 PM
I would suggest printing the string before it gets executed ive normally done that in web apps anyway just so you can see whats going on.

System.out.println(sqlStr);

stmt.execute(sqlStr);

Run both the one that works and the one that does and then compare them.

Im not exactly sure whats happening you probably do need to paste the code but do the debug first if your code works when you make the string your self and doesnt when you try to build it then its likely the string isnt correct but that usually has a different error....

Waylander.

keko2005
11-29-2005, 01:36 AM
i did do a comparison:

this is the actual comparison
CREATE TABLE test2(we char(8))
CREATE TABLE test2(we char(8))

any other suggestions?
thanks

keko2005
12-01-2005, 08:07 AM
found the error, for some reason it was because of my GUI. if i pass the same array from the driver with values already stored, everything works fine. its only when its taking information from my GUI tool that this error occurs. i will have to do some more debugging to find out how to make it work correctly. thanks for the help