Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #25736 > unrolled thread
| Started by | Lew <noone@lewscanon.com> |
|---|---|
| First post | 2011-02-06 22:35 -0500 |
| Last post | 2011-02-07 07:25 -0500 |
| Articles | 8 — 4 participants |
Back to article view | Back to comp.lang.java.programmer
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: The easiest framework for Java Database applications development released for production use Lew <noone@lewscanon.com> - 2011-02-06 22:35 -0500
Re: The easiest framework for Java Database applications development released for production use Arne Vajhøj <arne@vajhoej.dk> - 2011-02-07 18:04 -0500
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-07 18:59 -0800
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-07 19:18 -0800
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-06 20:30 -0800
Re: The easiest framework for Java Database applications development released for production use Steve Sobol <sjsobol@JustThe.net> - 2011-02-06 21:54 -0800
Re: The easiest framework for Java Database applications development released for production use Arne Vajhøj <arne@vajhoej.dk> - 2011-02-07 18:00 -0500
Re: The easiest framework for Java Database applications development released for production use Lew <noone@lewscanon.com> - 2011-02-07 07:25 -0500
| From | Lew <noone@lewscanon.com> |
|---|---|
| Date | 2011-02-06 22:35 -0500 |
| Subject | Re: The easiest framework for Java Database applications development released for production use |
| Message-ID | <iinp9v$765$1@news.albasani.net> |
yaormama@ĝmail.con says... >> Yaormama is the easiest ... >> Yaormama is also ... large >> Yaormama has been deployed and proven ... by single engineers >> as well as large ... software development teams. >> >> Please visit www.yaormama.orĝ for all of the details! Steve Sobol wrote: > There seems to be absolutely NOTHING special about the code snippet on > your product's home page. Forgive me for being ignorant, but I don't get > what the big deal is. The big deal is that the vapor-vendors at Yamorama think they're all that by spamming newsgroups, but they aren't. -- Lew Ceci n'est pas une fenêtre. .___________. |###] | [###| |##/ | *\##| |#/ * | \#| |#----|----#| || | * || |o * | o| |_____|_____| |===========|
[toc] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2011-02-07 18:04 -0500 |
| Message-ID | <4d507a88$0$23752$14726298@news.sunsite.dk> |
| In reply to | #25736 |
On 07-02-2011 07:25, Lew wrote: > yaormaAdmin wrote: >> Thanks for the feedback. The special bit in the code shown on the >> front page is in the Database.getData(sqlString, conn) call. >> Basically it encapsulates the boilerplate code that opens the cursor >> on the database side (e.g by creating a Statement and a ResultSet). >> Often in large projects someone, somewhere, inevitably forgets to > > Fire that person. There's nothing "inevitable" about such a rookie mistake. That can be a bit late. >> close the Statement and/or the Resultset in a finally block where an > > <http://download.oracle.com/javase/6/docs/api/java/sql/Statement.html#close()> > > "Note: When a Statement object is closed, its current ResultSet object, > if one exists, is also closed." It does not cost much to call close instead of hoping the JDBC driver implementator read the specs and the API docs. >> exception is thrown. This results in a cursor being left open in the >> database. Eventually the code is executed enough times to exhaust the >> maximum number of cursors allowed for the connection. The next call >> that opens a cursor in the database fails. This is often not the >> offending code but some perfectly good code that exists in some other >> far off place in the code. > > How "often" does that happen? What statistical basis do you have for > such a claim? Where is your evidence? ResultSet's are probably very rare. Connection's happen. >> Since yaorma encapsulates all of this boilerplate code (i.e. the >> allocation and deallocation of the Statement and Resultset objects and >> the opening and closing of the database cursors) this type of error is >> prevented. Also, its easier to get the data in the single >> Database.getData(sqlString, conn) call than to write the boilerplate > > And what if you aren't ready to deallocate the Statement? The philosophy in this type of library is not to cover everything, but to cover 90-95% of the cases. Those with more advanced requirements will have to look elsewhere. >> The pages in the more details link (http://www.yaormama.orĝ/pages/ >> details.html) at the bottom of the homepage go into some of this stuff >> as well as some of the other functionality including parametrized >> queries, the generation and use of data value objects, marshaling data >> from web pages, and marshaling data from the database in constant >> space (e.g. for large data sets) etc. > > How well does this sliced-bread thingie work with JPA? Given that it is not an ORM, then ..... Arne
[toc] | [prev] | [next] | [standalone]
| From | yaormaAdmin <yaorma@gmail.com> |
|---|---|
| Date | 2011-02-07 18:59 -0800 |
| Message-ID | <75cfb5b7-f308-4656-931e-890fbdc4d60e@x18g2000yqe.googlegroups.com> |
| In reply to | #25893 |
Thanks for the comments Arne,
Yup, the stuff discussed on the main page of the yaorma site as well
as in this thread doesn't touch on the object relational mapping piece
of yaorma. There is an ORM generator available as part of the yaroma
framework. The "Generate ORM link" takes you to a page that describes
how to generate the ORM classes. Again, the approach with the ORM
generator is to create a simple mapping of simple 1:1 data value
objects for database tables and views. Loading of the data into the
data objects in code that uses the data value objects can be handled
by the Dao (data access object) class of the framework. That code
would look something like the example from the database query link:
// StateDvo is a data value object that is essentially a 1:1 mapping
of the state database table
String sqlString = "select * from state order by state_name";
Data data = Database.query(sqlString, conn);
ArrayList<StateDvo> stateList = Dao.load(StateDvo.class, data);
request.setAttribute("stateList", stateList);
this.nextUrl = request.getParameter("nextUrl");
John
[toc] | [prev] | [next] | [standalone]
| From | yaormaAdmin <yaorma@gmail.com> |
|---|---|
| Date | 2011-02-07 19:18 -0800 |
| Message-ID | <cbaec1fc-4d27-452b-9425-9de9367d6991@s11g2000yqh.googlegroups.com> |
| In reply to | #26114 |
Hi Everybody,
This is what code that needs to either process the result set as it is
fetched (e.g. larger data sets) or needs to do something more with the
data might look like. The necessary database resources will be
allocated and deallocated by the framework immediately prior to and
immediately after the call to echoToConsole. The choice to use
reflection rather than an interface was driven by the need to have any
number of database data processing calls in a single class. This is a
complete example that should compile and run with out any additional
hand written code (given the existence of the underlying database) and
with only the database driver jar and the yaorma jar.
Sorry I won't be able to post the complete example to the web site
tonight but I'll get it there as soon as I can.
Thanks again for all of your help and feedback,
John
----8<-----------------8<-----------------
package org.yaorma.examples.resultSetUser.main;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import org.yaorma.database.Data;
import org.yaorma.database.Database;
public class YaormaDataUserExample {
public static void main(String[] args) throws Exception {
new YaormaDataUserExample().exe();
}
public void exe() throws Exception {
// some configuration parameters
String dbDriverClassName = "oracle.jdbc.driver.OracleDriver";
String dbUrl = "jdbc:oracle:thin:@localhost:1521:orcl";
String dbUid = "guest";
String dbPwd = "guestpwd";
// get a connection
Class.forName(dbDriverClassName);
Connection conn = DriverManager.getConnection(dbUrl, dbUid, dbPwd);
// use yaorma to get the database data
String sqlString = "select * from test_table order by row_id";
Database.query(this, "echoToConsole", conn, sqlString);
// done
System.out.println("Done!");
}
public void echoToConsole(ResultSet rs) throws Exception {
while(rs.next()) {
System.out.print(rs.getString("row_id"));
System.out.print(rs.getString("message"));
System.out.print("\n");
// use the data in any way you choose here
}
}
}
[toc] | [prev] | [next] | [standalone]
| From | yaormaAdmin <yaorma@gmail.com> |
|---|---|
| Date | 2011-02-06 20:30 -0800 |
| Message-ID | <92e64642-b624-4598-beaa-c57540a30733@k22g2000yqh.googlegroups.com> |
| In reply to | #25736 |
On Feb 6, 10:35 pm, Lew <no...@lewscanon.com> wrote: > yaormama@ĝmail.con says... > > >> Yaormama is the easiest ... > >> Yaormama is also ... large > >> Yaormama has been deployed and proven ... by single engineers > >> as well as large ... software development teams. > > >> Please visitwww.yaormama.orĝfor all of the details! > Steve Sobol wrote: > > There seems to be absolutely NOTHING special about the code snippet on > > your product's home page. Forgive me for being ignorant, but I don't get > > what the big deal is. > > The big deal is that the vapor-vendors at Yamorama think they're all that by > spamming newsgroups, but they aren't. > > -- > Lew > Ceci n'est pas une fenêtre. > .___________. > |###] | [###| > |##/ | *\##| > |#/ * | \#| > |#----|----#| > || | * || > |o * | o| > |_____|_____| > |===========| Thanks for the feedback. The special bit in the code shown on the front page is in the Database.getData(sqlString, conn) call. Basically it encapsulates the boilerplate code that opens the cursor on the database side (e.g by creating a Statement and a ResultSet). Often in large projects someone, somewhere, inevitably forgets to close the Statement and/or the Resultset in a finally block where an exception is thrown. This results in a cursor being left open in the database. Eventually the code is executed enough times to exhaust the maximum number of cursors allowed for the connection. The next call that opens a cursor in the database fails. This is often not the offending code but some perfectly good code that exists in some other far off place in the code. Since yaorma encapsulates all of this boilerplate code (i.e. the allocation and deallocation of the Statement and Resultset objects and the opening and closing of the database cursors) this type of error is prevented. Also, its easier to get the data in the single Database.getData(sqlString, conn) call than to write the boilerplate code to create the statement, create the result set, iterate through the result set, marshal the data into some type of data object, close the result set in a finally block, close the statement in a finally block, etc. The pages in the more details link (http://www.yaorma.org/pages/ details.html) at the bottom of the homepage go into some of this stuff as well as some of the other functionality including parametrized queries, the generation and use of data value objects, marshaling data from web pages, and marshaling data from the database in constant space (e.g. for large data sets) etc. Hope this helps, John
[toc] | [prev] | [next] | [standalone]
| From | Steve Sobol <sjsobol@JustThe.net> |
|---|---|
| Date | 2011-02-06 21:54 -0800 |
| Message-ID | <MPG.27b929031fbf8fa59897ca@news.justthe.net> |
| In reply to | #25925 |
In article <92e64642-b624-4598-beaa-c57540a30733 @k22g2000yqh.googlegroups.com>, yaorma@gmail.com says... > Thanks for the feedback. The special bit in the code shown on the > front page is in the Database.getData(sqlString, conn) call. OK, let me give you a little more feedback. For ORM, I'm either going to use a full-featured library like Hibernate or Toplink, or I'm going to use ActiveObjects. > The pages in the more details link (http://www.yaorma.org/pages/ > details.html) at the bottom of the homepage go into some of this stuff > as well as some of the other functionality including parametrized > queries, the generation and use of data value objects, marshaling data > from web pages, and marshaling data from the database in constant > space (e.g. for large data sets) etc. Really, I think your homepage sucks. There is a serious lack of information there. -- Steve Sobol - Programming/Web Dev/IT Support Apple Valley, CA sjsobol@JustThe.net
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2011-02-07 18:00 -0500 |
| Message-ID | <4d507995$0$23761$14726298@news.sunsite.dk> |
| In reply to | #25925 |
On 06-02-2011 23:30, yaormaAdmin wrote: > On Feb 6, 10:35 pm, Lew<no...@lewscanon.com> wrote: >> yaormama@ĝmail.con says... >> >>>> Yaormama is the easiest ... >>>> Yaormama is also ... large >>>> Yaormama has been deployed and proven ... by single engineers >>>> as well as large ... software development teams. >> >>>> Please visitwww.yaormama.orĝfor all of the details! >> Steve Sobol wrote: >>> There seems to be absolutely NOTHING special about the code snippet on >>> your product's home page. Forgive me for being ignorant, but I don't get >>> what the big deal is. >> >> The big deal is that the vapor-vendors at Yamorama think they're all that by >> spamming newsgroups, but they aren't. > Thanks for the feedback. The special bit in the code shown on the > front page is in the Database.getData(sqlString, conn) call. > Basically it encapsulates the boilerplate code that opens the cursor > on the database side (e.g by creating a Statement and a ResultSet). > Often in large projects someone, somewhere, inevitably forgets to > close the Statement and/or the Resultset in a finally block where an > exception is thrown. This results in a cursor being left open in the > database. Eventually the code is executed enough times to exhaust the > maximum number of cursors allowed for the connection. The next call > that opens a cursor in the database fails. This is often not the > offending code but some perfectly good code that exists in some other > far off place in the code. > > Since yaorma encapsulates all of this boilerplate code (i.e. the > allocation and deallocation of the Statement and Resultset objects and > the opening and closing of the database cursors) this type of error is > prevented. Also, its easier to get the data in the single > Database.getData(sqlString, conn) call than to write the boilerplate > code to create the statement, create the result set, iterate through > the result set, marshal the data into some type of data object, close > the result set in a finally block, close the statement in a finally > block, etc. So it is more like MS DAAB than an ORM? Arne
[toc] | [prev] | [next] | [standalone]
| From | Lew <noone@lewscanon.com> |
|---|---|
| Date | 2011-02-07 07:25 -0500 |
| Message-ID | <iioobf$h14$1@news.albasani.net> |
| In reply to | #25925 |
yaormaAdmin wrote: > Thanks for the feedback. The special bit in the code shown on the > front page is in the Database.getData(sqlString, conn) call. > Basically it encapsulates the boilerplate code that opens the cursor > on the database side (e.g by creating a Statement and a ResultSet). > Often in large projects someone, somewhere, inevitably forgets to Fire that person. There's nothing "inevitable" about such a rookie mistake. > close the Statement and/or the Resultset in a finally block where an <http://download.oracle.com/javase/6/docs/api/java/sql/Statement.html#close()> "Note: When a Statement object is closed, its current ResultSet object, if one exists, is also closed." > exception is thrown. This results in a cursor being left open in the > database. Eventually the code is executed enough times to exhaust the > maximum number of cursors allowed for the connection. The next call > that opens a cursor in the database fails. This is often not the > offending code but some perfectly good code that exists in some other > far off place in the code. How "often" does that happen? What statistical basis do you have for such a claim? Where is your evidence? > Since yaorma encapsulates all of this boilerplate code (i.e. the > allocation and deallocation of the Statement and Resultset objects and > the opening and closing of the database cursors) this type of error is > prevented. Also, its easier to get the data in the single > Database.getData(sqlString, conn) call than to write the boilerplate And what if you aren't ready to deallocate the Statement? > code to create the statement, create the result set, iterate through > the result set, marshal the data into some type of data object, close > the result set in a finally block, close the statement in a finally > block, etc. You make it sound much harder than it really is. Remember, closing the 'Staztement' also closes the 'ResultSet'? Of course, being a helpful API write, surely you knew that already. If you didn't, how could we trust your API given that level of ignorance? Marshaling the data is not boilerplate. It depends on the particular data to marshal, i.e., the structures of the tables and entities. Iteration is all of one expressions, rs.next(), in a loop condition. The 'try' ... 'finally' is embedded into the subconscious of every competent Java programmer. Taking away control of that from the programmer is not usually a good thing. > The pages in the more details link (http://www.yaormama.orĝ/pages/ > details.html) at the bottom of the homepage go into some of this stuff > as well as some of the other functionality including parametrized > queries, the generation and use of data value objects, marshaling data > from web pages, and marshaling data from the database in constant > space (e.g. for large data sets) etc. How well does this sliced-bread thingie work with JPA? -- Lew Ceci n'est pas une fenêtre. .___________. |###] | [###| |##/ | *\##| |#/ * | \#| |#----|----#| || | * || |o * | o| |_____|_____| |===========|
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web