Weird error when i try to run select * from partner from sqltool

Hi!

I'm working now for to run an sql sentence for example

select * from partner

That's my command line and configuration file

java -jar sqltool-2.2.6.jar --rcFile=./mendelson.rec mendelson

---------------INFO MENDELSON.REC FILE-------------------------

urlid mendelson
url jdbc:hsqldb:hsql://127.0.0.1:3333/config
username SA
password as2dbadmin

---------------------------------------------------------------

If I want to run for example: select * from certificates

sql> select * from certificates;
ID PARTNERID FINGERPRINTSHA1 CATEGORY PRIO
-- --------- ---------------------------------------------------------- -------- ----
0 0 3D:A0:27:42:4D:92:6D:4:BB:74:66:1D:48:3E:61:6A:46:2A:5:B7 1 1
1 0 3D:A0:27:42:4D:92:6D:4:BB:74:66:1D:48:3E:61:6A:46:2A:5:B7 2 1
2 1 6D:9A:2C:79:02:B:F1:6B:20:78:E4:A3:BE:DF:93:DD:2A:AD:B7:40 1 1
3 1 6D:9A:2C:79:02:B:F1:6B:20:78:E4:A3:BE:DF:93:DD:2A:AD:B7:40 2 1

Ready!

But If I want to run select * from partner

sql> select * from PARTNER;
SEVERE Rolling back SQL transaction.
Exception in thread "main" java.lang.NullPointerException
at org.hsqldb.cmdline.SqlFile.streamToBytes(Unknown Source)
at org.hsqldb.cmdline.SqlFile.displaySqlResults(Unknown Source)
at org.hsqldb.cmdline.SqlFile.scanpass(Unknown Source)
at org.hsqldb.cmdline.SqlFile.execute(Unknown Source)
at org.hsqldb.cmdline.SqlTool.objectMain(Unknown Source)
at org.hsqldb.cmdline.SqlTool.main(Unknown Source)
[root@mendelson jlib]#

What's the wrong??

Thanks in advance,
Pablo

Forum
AS2

Comments

Permalink

Hi Albertom

I can use PARTNER or partner and the result is the same weird error, perhaps HSQLDB wait a transaction for partner table, but i don't know how i can release it...

Greetings
Pablo

Permalink

Well, i have to use Squirrel-SQL for execute the followinf SQL Sentence, run without error:

INSERT INTO partner (as2ident ,name, islocal, sign, encrypt, email, url, mdnurl, subject, contenttype, syncmdn, pollignorelist, pollinterval, compression, signedmdn, commandonreceipt, usecommandonreceipt, usehttpauth, httpauthuser, httpauthpass, usehttpauthasyncmdn, httpauthuserasnymdn, httpauthpassasnymdn, keeporiginalfilenameonreceipt, partnercomment, notifysend, notifyreceive, notifysendreceive, notifysendenabled, notifyreceiveenabled, notifysendreceiveenabled, commandonsenderror, usecommandonsenderror, commandonsendsuccess, usecommandonsendsuccess, contenttransferencoding, httpversion, maxpollfiles, partnercontact, partneraddress) VALUES ('AS2KK','KK',0,2,2,'xx@bbr.cl','http://url1','http://url2','AS2 Message','application/EDI-Consent',1,NULL,10,1,1,'c:/mendelson/mbi/SendToMBI.exe -file ${filename} -media as2',0,0,'','',0,'','',1,NULL,0,0,0,0,0,0,'NADA COMMANDSENDERROR',0,'COMANDO SENDSUCCESS',0,1,'1.1',100,NULL,NULL)

The strange behavior to manipulate the partner table, appears again .., if you run this code is hung.., why? perhaps wait a transaction...

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class InsertQuery {
public static void main(String[] args) {
Connection con = null;
Statement stmt = null;
String Comando = "INSERT INTO partner (as2ident ,name, islocal, sign, encrypt, email, url, mdnurl, subject, contenttype, syncmdn, pollignorelist, pollinterval, compression, signedmdn, commandonreceipt, usecommandonreceipt, usehttpauth, httpauthuser, httpauthpass, usehttpauthasyncmdn, httpauthuserasnymdn, httpauthpassasnymdn, keeporiginalfilenameonreceipt, partnercomment, notifysend, notifyreceive, notifysendreceive, notifysendenabled, notifyreceiveenabled, notifysendreceiveenabled, commandonsenderror, usecommandonsenderror, commandonsendsuccess, usecommandonsendsuccess, contenttransferencoding, httpversion, maxpollfiles, partnercontact, partneraddress) VALUES ('AS2KK','KK',0,2,2,'xx@bbr.cl','http://url1','http://url2','AS2 Message','application/EDI-Consent',1,NULL,10,1,1,'c:/mendelson/mbi/SendToMBI.exe -file ${filename} -media as2',0,0,'','',0,'','',1,NULL,0,0,0,0,0,0,'NADA COMMANDSENDERROR',0,'COMANDO SENDSUCCESS',0,1,'1.1',100,NULL,NULL)";
int result = 0;
try {
Class.forName("org.hsqldb.jdbc.JDBCDriver");
con = DriverManager.getConnection( "jdbc:hsqldb:hsql://localhost:3333/config", "SA", "as2dbadmin");
stmt = con.createStatement();
System.out.println("Comando : "+Comando);
result = stmt.executeUpdate(Comando);
con.commit();
}catch (Exception e) {
e.printStackTrace(System.out);
}
System.out.println(result+" rows effected");
System.out.println("Rows inserted successfully");
}
}

for to run this code, you must to execute:

java -cp "./:/opt/Mendelson/jlib/hsqldb.jar" InsertQuery

thanks in advance, for any help

-Pablo