Re: !%@$#%@ DataSource
[email protected] Sat, 14 Mar 2009 11:55:30 +1000
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <[email protected]> |
The reason that SimpleORM takes a DataSource parameter instead of a JDBC Connection was so that it could open a second connection as a way to generate sequence numbers. However this sequence number generation was never implemented, and realistically is not likely to be implemented given that now all databases have internal hacks that do essentially the same thing. So yes, I think that we could go back to Connection, and deprecate DataSource or leave it there for convenience. For now, it is trivial to wrap a Connection in a DataSource. It only ever needs to produce one. An unrelated enhancement I am considering is to make SRecordInstance implement Map. So that it can look exactly like a map from field names to field values. This would make it much more compatible with expression language tools such as JSP, JSF. Regards, Anthony At 04:33 AM 14/03/2009, you wrote: >As I mentioned, I'm moving to SimpleORM 3 from SimpleORM 2 via Hibernate. > >I'm having trouble with the idea of writing an implementation of javax.sql.Datasource. In V2 I didn't have to write anything like that. I suppose I could just copy the example in TestUte but this seems like such basic functionality that it should be provided by javax.sql or by the JDBC driver that I'm using. I should be able to do something like > >getDatabaseDriverFromConnectionString(myConnectionString).getConnectionPool().getDataSource() > >or something, right? Can't I use the connection string to find the right JDBC driver, and then use the JDBC driver to get a connection pool, and then use the connection pool to get a DataSource? > >Am I completely out to lunch? What am I missing? Why is it so much harder to connect to the database using the new JDBC (and hence the new SimpleORM)? > >ARghh, thanks for listening and for any advice. > >-- >John Abraham ><mailto:jabraham%40ucalgary.ca>[email protected] > > Dr Anthony Berglas, [email protected] Mobile: +61 4 4838 8874 Just because it is possible to push twigs along the ground with ones nose does not necessarily mean that is the best way to collect firewood. ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/SimpleORM/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/SimpleORM/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
af44820.jpg
(image/jpeg, 3.3 KB) - not displayed