I hope you are all ok with the frequency of this question following my last, im struggling alot with this database stuff. and i really appreciate all the help from this forum, many a time you have saved my computer from a trip out my window lol.
now im trying to create a derby database at runtime in my java code...ive created and used databases on the hard drive, but now im trying to move toward the net and started with the localhost.
im getting this error consistanlty at runtime:
if you wouldnt mind taking a peek at my code here is the method where the magic happens:
[CODE=cpp]
public static void createOnlineDB( String DBName)
{
try{
Class.forName(" org.apache.derb y.jdbc.Embedded Driver").newIns tance();
Debug.println(" class loaded.");
System.setPrope rty("derby.drda .startNetworkSe rver","true");
Debug.println(" startNetworkSer ver property set true");
conn = DriverManager.g etConnection("j dbc:derby://localhost:80/ttg/"+DBName+";crea te=true");
conn.commit();
conn.close();
}catch(Exceptio n e){e.printStack Trace();}
}[/CODE]
that starts at line 135.
debug is basically system.out.prin tln with an on/off switch. i coded it so i could quickly shut off unsighlty things when showing my friends the work so far...
i really appreciate any help,
thanks,
ken
now im trying to create a derby database at runtime in my java code...ive created and used databases on the hard drive, but now im trying to move toward the net and started with the localhost.
im getting this error consistanlty at runtime:
Code:
[I]java.sql.SQLNonTransientConnectionException: Insufficient data while reading fro
m the network - expected a minimum of 6 bytes and received only -1 bytes. The c
onnection has been terminated.
at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unkn
own Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Sourc
e)
at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:207)
at DataBaseReader.createOnlineDB(DataBaseReader.java:142)
at ToTheGallows.main(ToTheGallows.java:31)
Caused by: org.apache.derby.client.am.DisconnectException: Insufficient data whi
le reading from the network - expected a minimum of 6 bytes and received only -1
bytes. The connection has been terminated.
at org.apache.derby.client.net.Reply.fill(Unknown Source)
at org.apache.derby.client.net.Reply.ensureALayerDataInBuffer(Unknown So
urce)
at org.apache.derby.client.net.Reply.readDssHeader(Unknown Source)
at org.apache.derby.client.net.Reply.startSameIdChainParse(Unknown Sourc
e)
at org.apache.derby.client.net.NetConnectionReply.readExchangeServerAttr
ibutes(Unknown Source)
at org.apache.derby.client.net.NetConnection.readServerAttributesAndKeyE
xchange(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowServerAttributesAndKeyE
xchange(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(Unknown
Source)
at org.apache.derby.client.net.NetConnection.flowConnect(Unknown Source)
at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConne
ction(Unknown Source)
... 5 more[/I]
[CODE=cpp]
public static void createOnlineDB( String DBName)
{
try{
Class.forName(" org.apache.derb y.jdbc.Embedded Driver").newIns tance();
Debug.println(" class loaded.");
System.setPrope rty("derby.drda .startNetworkSe rver","true");
Debug.println(" startNetworkSer ver property set true");
conn = DriverManager.g etConnection("j dbc:derby://localhost:80/ttg/"+DBName+";crea te=true");
conn.commit();
conn.close();
}catch(Exceptio n e){e.printStack Trace();}
}[/CODE]
that starts at line 135.
debug is basically system.out.prin tln with an on/off switch. i coded it so i could quickly shut off unsighlty things when showing my friends the work so far...
i really appreciate any help,
thanks,
ken
Comment