wip made remote ejb working over http
This commit is contained in:
parent
d4e537a2bf
commit
2a0d992642
393 changed files with 8916 additions and 3872 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<artifactId>vasc-backend</artifactId>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<version>0.3.5-SNAPSHOT</version>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>vasc-backend-jdbc</artifactId>
|
||||
|
|
|
|||
|
|
@ -27,11 +27,12 @@ import java.sql.SQLException;
|
|||
|
||||
|
||||
/**
|
||||
* JdbcConnectionProvider interface to get jdbc connection.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Sep 5, 2008
|
||||
*/
|
||||
public interface JdbcConnectionProvider {
|
||||
|
||||
public Connection getJdbcConnection() throws SQLException;
|
||||
Connection getJdbcConnection() throws SQLException;
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ import java.sql.SQLException;
|
|||
|
||||
|
||||
/**
|
||||
* JdbcConnectionProviderImpl creates jdbc connection from driver manager.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 15, 2009
|
||||
|
|
@ -111,7 +112,4 @@ public class JdbcConnectionProviderImpl implements JdbcConnectionProvider {
|
|||
public void setDbPassword(String dbPassword) {
|
||||
this.dbPassword = dbPassword;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import javax.naming.NamingException;
|
|||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* JdbcConnectionProviderJdniImpl provides jdbc connection from jndi data source.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 15, 2009
|
||||
|
|
@ -70,36 +71,32 @@ public class JdbcConnectionProviderJdniImpl implements JdbcConnectionProvider {
|
|||
throw new SQLException("Cannot get connection " + e,e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the dataSourceContext
|
||||
*/
|
||||
public String getDataSourceContext() {
|
||||
return dataSourceContext;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param dataSourceContext the dataSourceContext to set
|
||||
*/
|
||||
public void setDataSourceContext(String dataSourceContext) {
|
||||
this.dataSourceContext = dataSourceContext;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the dataSourceName
|
||||
*/
|
||||
public String getDataSourceName() {
|
||||
return dataSourceName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param dataSourceName the dataSourceName to set
|
||||
*/
|
||||
public void setDataSourceName(String dataSourceName) {
|
||||
this.dataSourceName = dataSourceName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,13 +36,14 @@ import net.forwardfire.vasc.backend.data.MapVascEntryFieldValue;
|
|||
import net.forwardfire.vasc.backend.data.MapVascEntryRecordCreator;
|
||||
import net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
import net.forwardfire.vasc.core.entry.VascEntryFieldValue;
|
||||
import net.forwardfire.vasc.core.entry.VascEntryRecordCreator;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* JdbcVascBackend Simple jdbc vasc backend.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Sep 5, 2008
|
||||
|
|
@ -160,7 +161,4 @@ public class JdbcVascBackend extends AbstractVascBackend {
|
|||
public void setSqlList(String sqlList) {
|
||||
this.sqlList = sqlList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,14 +36,15 @@ import net.forwardfire.vasc.backend.data.MapVascEntryFieldValue;
|
|||
import net.forwardfire.vasc.backend.data.MapVascEntryRecordCreator;
|
||||
import net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
import net.forwardfire.vasc.core.entry.VascEntryFieldValue;
|
||||
import net.forwardfire.vasc.core.entry.VascEntryRecordCreator;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
import net.forwardfire.vasc.xpql.query.QueryParameterValue;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* JdbcVascBackendXpql jdbc vasc backend with xpql query support.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Sep 5, 2008
|
||||
|
|
@ -94,24 +95,24 @@ public class JdbcVascBackendXpql extends AbstractVascBackend {
|
|||
* @see net.forwardfire.vasc.backend.VascBackend#execute(VascBackendState state)
|
||||
*/
|
||||
public List<Object> execute(VascBackendState state) throws VascException {
|
||||
// Copy parameters
|
||||
for (String key:state.getDataParameterKeys()) {
|
||||
Object value = state.getDataParameter(key);
|
||||
query.setQueryParameter(key, value);
|
||||
}
|
||||
// Copy parameters
|
||||
for (String key:state.getDataParameterKeys()) {
|
||||
Object value = state.getDataParameter(key);
|
||||
query.setQueryParameter(key, value);
|
||||
}
|
||||
Connection c = null;
|
||||
try {
|
||||
c = getJdbcConnectionProvider().getJdbcConnection();;
|
||||
PreparedStatement q = c.prepareStatement(query.toPreparedSQL(query));
|
||||
|
||||
List<QueryParameterValue> values = query.getOrderQueryParameterValues();
|
||||
int ii = 1;
|
||||
for (QueryParameterValue value:values) {
|
||||
q.setObject(ii,value.getValue());
|
||||
ii++;
|
||||
}
|
||||
q.execute();
|
||||
ResultSet rs = q.getResultSet();
|
||||
|
||||
List<QueryParameterValue> values = query.getOrderQueryParameterValues();
|
||||
int ii = 1;
|
||||
for (QueryParameterValue value:values) {
|
||||
q.setObject(ii,value.getValue());
|
||||
ii++;
|
||||
}
|
||||
q.execute();
|
||||
ResultSet rs = q.getResultSet();
|
||||
int cols = rs.getMetaData().getColumnCount();
|
||||
List<Object> result = new ArrayList<Object>(50);
|
||||
while (rs.next()) {
|
||||
|
|
@ -126,14 +127,14 @@ public class JdbcVascBackendXpql extends AbstractVascBackend {
|
|||
return result;
|
||||
} catch (Exception e) {
|
||||
throw new VascException(e);
|
||||
} finally {
|
||||
if (c!=null) {
|
||||
try {
|
||||
c.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (c!=null) {
|
||||
try {
|
||||
c.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,12 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<eld:root xmlns:eld="http://eld.x4o.org/eld/eld-lang.eld">
|
||||
|
||||
<eld:elementClass tag="jdbcBackend" objectClassName="net.forwardfire.vasc.backend.jdbc.JdbcVascBackend"/>
|
||||
<eld:elementClass tag="jdbcConnectionProvider" objectClassName="net.forwardfire.vasc.backend.jdbc.JdbcConnectionProviderImpl"/>
|
||||
<eld:elementClass tag="jdbcConnectionProviderJndi" objectClassName="net.forwardfire.vasc.backend.jdbc.JdbcConnectionProviderJdniImpl"/>
|
||||
|
||||
<eld:elementClass tag="jdbcBackendXpql" objectClassName="net.forwardfire.vasc.backend.jdbc.JdbcVascBackendXpql">
|
||||
<eld:elementConfigurator bean.class="net.forwardfire.vasc.impl.x4o.VascBackendElementConfigurator" configAction="true"/>
|
||||
</eld:elementClass>
|
||||
|
||||
</eld:root>
|
||||
<root:module
|
||||
xmlns="http://eld.x4o.org/xml/ns/eld-lang"
|
||||
xmlns:root="http://eld.x4o.org/xml/ns/eld-root"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://eld.x4o.org/xml/ns/eld-root http://eld.x4o.org/xml/ns/eld-root-1.0.xsd"
|
||||
providerName="vasc.forwardfire.net"
|
||||
name="Vasc Backend JDBC"
|
||||
id="vasc-backend-jdbc"
|
||||
>
|
||||
<description>Provides VASC JDBC backend support.</description>
|
||||
<namespace uri="http://vasc.forwardfire.net/xml/ns/vasc-backend-jdbc"
|
||||
schemaUri="http://vasc.forwardfire.net/xml/ns/vasc-backend-jdbc-1.0.xsd"
|
||||
schemaResource="vasc-backend-jdbc-1.0.xsd"
|
||||
schemaPrefix="jdbc"
|
||||
name="Vasc Backend JDBC"
|
||||
id="ns-vasc-backend-jdbc"
|
||||
>
|
||||
<description>Provides backend and connection provider support.</description>
|
||||
<element tag="jdbcConnectionProvider" objectClass="net.forwardfire.vasc.backend.jdbc.JdbcConnectionProviderImpl"/>
|
||||
<element tag="jdbcConnectionProviderJndi" objectClass="net.forwardfire.vasc.backend.jdbc.JdbcConnectionProviderJdniImpl"/>
|
||||
<element tag="jdbcBackend" objectClass="net.forwardfire.vasc.backend.jdbc.JdbcVascBackend"/>
|
||||
<element tag="jdbcBackendXpql" objectClass="net.forwardfire.vasc.backend.jdbc.JdbcVascBackendXpql">
|
||||
<configurator id="jdbcBackendXpql-VascBackendElementConfigurator" bean.class="net.forwardfire.vasc.impl.x4o.VascBackendElementConfigurator" configAction="true"/>
|
||||
</element>
|
||||
</namespace>
|
||||
</root:module>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<modules version="1.0"
|
||||
xmlns="http://language.x4o.org/xml/ns/modules"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://language.x4o.org/xml/ns/modules http://language.x4o.org/xml/ns/modules-1.0.xsd"
|
||||
>
|
||||
<language version="1.0">
|
||||
<eld-resource>vasc-backend-jdbc.eld</eld-resource>
|
||||
</language>
|
||||
</modules>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
<properties>
|
||||
<comment>
|
||||
Vasc namespace for the jdbc backend
|
||||
</comment>
|
||||
<entry key="eld.http://vasc.forwardfire.net/eld/vasc-backend-jdbc.eld">vasc-backend-jdbc.eld</entry>
|
||||
</properties>
|
||||
Loading…
Add table
Add a link
Reference in a new issue