Community
Participate
Working Groups
All SQL actions generate to empty java code (only a ;) attached is an sample egl and the generated Java ===EGL=== package tests; import eglx.lang.BasicProgram; import eglx.persistence.sql.SQLDataSource; program T1 type BasicProgram {} function main() ds sqldatasource = new sqldatasource("aaa"); myRecord MyRecord; add myRecord to ds; end end record MyRecord itemName string; end ===Generated Java ==== package tests; import org.eclipse.edt.javart.resources.*; import org.eclipse.edt.javart.*; import org.eclipse.edt.runtime.java.egl.lang.EglAny; import tests.MyRecord; import eglx.persistence.sql.SQLDataSource; @javax.xml.bind.annotation.XmlRootElement(name="T1") public class T1 extends ProgramBase { private static final long serialVersionUID = 10L; public static void main(String... ezeargs) throws Exception { StartupInfo info = new StartupInfo( "T1", "tests/T1.properties", ezeargs ); RunUnit ru = new JSERunUnit( info ); org.eclipse.edt.javart.Runtime.setStaticRunUnit( ru ); ru.start( new T1() ); ru.exit(); } public T1() { super(); ezeInitialize(); } public void ezeInitialize() { } public void main() { SQLDataSource ds; ds = new SQLDataSource("aaa"); MyRecord myRecord = new MyRecord(); ; } }
I'm not able to reproduce the problem you are seeing. I copied your EGL and here is what I get in the main(): public void main() { SQLDataSource ds; ds = new SQLDataSource("aaa"); MyRecord1 myRecord = new MyRecord1(); try { java.sql.PreparedStatement ezeStatement = (java.sql.PreparedStatement)ds.getStatement("programs.T1", 0); if (ezeStatement== null) { String stmtStr = "INSERT INTO MyRecord1(itemName) VALUES (?)"; ezeStatement = ds.getConnection().prepareStatement(stmtStr); ds.registerStatement("programs.T1", 0, ezeStatement); } ezeStatement.setString(1, myRecord.itemName); ezeStatement.execute(); } catch(java.sql.SQLException ezeEx) { throw new eglx.persistence.sql.SQLException(ezeEx); } ; } If you still see a problem can you attached the log and if you are in a dev env any trace you see in the console.
Reopening for Kathy.
I had Matt reopen this problem for me. This problem is happening for me using install build 201109281128.
This is caused by the same problem as bug 358568. Until it's fixed, use a Sun JRE not an IBM JRE. *** This bug has been marked as a duplicate of bug 358568 ***
close this.