Back to project page jepldroid.
The source code is released under:
Apache License
If you think the Android project jepldroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package jepl.impl.nonjta.android; // w w w . j av a 2 s .c o m import java.sql.Connection; import java.sql.SQLException; import java.util.concurrent.atomic.AtomicBoolean; import javax.sql.DataSource; import jepl.impl.JEPLConnectionImpl; import jepl.impl.nonjta.JEPLBootNonJTAImpl; import jepl.impl.nonjta.JEPLNonJTADataSourceImpl; public class JEPLNonJTADataSourceAndroidImpl extends JEPLNonJTADataSourceImpl { protected AtomicBoolean sqlDroidChecked = new AtomicBoolean(false); protected volatile boolean sqlDroid = false; public JEPLNonJTADataSourceAndroidImpl(JEPLBootNonJTAImpl boot,DataSource ds) { super(boot,ds); } @Override public JEPLConnectionImpl createJEPLConnection(Connection con) throws SQLException { if (!sqlDroidChecked.get()) { String driverNameLower = con.getMetaData().getDriverName().toLowerCase(); this.sqlDroid = driverNameLower.contains("sqldroid"); sqlDroidChecked.set(true); } if (sqlDroid) return new JEPLNonJTAConnectionSQLDroidImpl(this,con); // Este constructor no dar nunca error else return super.createJEPLConnection(con); } }