Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358084 - All SQL actions generate to empty java code
Summary: All SQL actions generate to empty java code
Status: CLOSED DUPLICATE of bug 358568
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Tim Wilson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-19 06:31 EDT by Tony Chen CLA
Modified: 2017-02-23 14:18 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chen CLA 2011-09-19 06:31:13 EDT
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();
		;
	}
}
Comment 1 Joseph Vincens CLA 2011-09-20 19:00:57 EDT
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.
Comment 2 Matt Heitz CLA 2011-09-28 13:05:51 EDT
Reopening for Kathy.
Comment 3 Kathy Carroll CLA 2011-09-28 13:25:09 EDT
I had Matt reopen this problem for me. This problem is happening for me using install build 201109281128.
Comment 4 Matt Heitz CLA 2011-09-28 15:28:17 EDT
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 ***
Comment 5 Tony Chen CLA 2011-10-20 07:43:19 EDT
close this.