Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.databases > #339 > unrolled thread
| Started by | "Thufir" <thufir@THRWHITE.remove-dii-this> |
|---|---|
| First post | 2011-04-27 15:23 +0000 |
| Last post | 2011-04-27 15:23 +0000 |
| Articles | 6 — 3 participants |
Back to article view | Back to comp.lang.java.databases
Generating the Entity Cla "Thufir" <thufir@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: Generating the Entity "=?UTF-8?B?QXJuZSBWYWpow7h" <=?utf-8?b?qxjuzsbwywpow7h@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: Generating the Entity "Thufir" <thufir@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: Generating the Entity "=?UTF-8?B?QXJuZSBWYWpow7h" <=?utf-8?b?qxjuzsbwywpow7h@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: Generating the Entity "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: Generating the Entity "=?UTF-8?B?QXJuZSBWYWpow7h" <=?utf-8?b?qxjuzsbwywpow7h@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
| From | "Thufir" <thufir@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:23 +0000 |
| Subject | Generating the Entity Cla |
| Message-ID | <%35Sk.4261$9Z6.119@newsfe01.iad> |
To: comp.lang.java.databases I'm just doing some basic, introductory servlet web app stuff. I'm connecting to a remote Microsoft SQL 2005 server, which I connect to with: driver: com.microsoft.sqlserver.jdbc.SQLServerDriver "url": jdbc:sqlserver://foo.com The db shows in the netbeans IDE, and I can add tables, etc, through NetBeans. Here's the manual which I'm referencing for generating the bean which corresponds to the table: # In the Projects window, right-click the ConsultingAgency node, and choose New > Entity Classes from Database. # Select New Data Source from the Data Source drop-down list to open the Create Data Source dialog. # Type jdbc/consult as the JNDI Name and select jdbc:derby:// localhost:1527/consult [consult on CONSULT] as the Database Connection. Click OK to close the dialog box and return to the wizard. http://www.netbeans.org/kb/61/web/jsf-jpa-crud-wizard.html#03 However, I know nothing beyond wikipedia about JNDI What do I enter in the JNDI field? This seems to lead into EJB territory, which I'll stay out of for the time being. I tried entering jdbc/myWebApp as the JNDI name, which sorta-kinda worked. This allowed me to see some tables. (Some were tables were greyed out an unknown reason.) I then use the TOP<something or other> from Oracle, and an entity class *was* created automagically. However, it failed to compile. Rather than deal with why it failed to compile, I thought I'd ask for some general info about the process of generating an entity class (bean?) automagically from within NB. I'll keep looking for tutorials similar to the one referenced above for context. thanks, Thufir --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [next] | [standalone]
| From | "=?UTF-8?B?QXJuZSBWYWpow7h" <=?utf-8?b?qxjuzsbwywpow7h@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:23 +0000 |
| Subject | Re: Generating the Entity |
| Message-ID | <4918ec9e$0$90266$14726298@news.sunsite.dk> |
| In reply to | #339 |
To: comp.lang.java.databases Thufir wrote: > I'm just doing some basic, introductory servlet web app stuff. I'm > connecting to a remote Microsoft SQL 2005 server, which I connect to > with: > > driver: com.microsoft.sqlserver.jdbc.SQLServerDriver > "url": jdbc:sqlserver://foo.com > > > The db shows in the netbeans IDE, and I can add tables, etc, through > NetBeans. > > Here's the manual which I'm referencing for generating the > bean which corresponds to the table: > > # In the Projects window, right-click the ConsultingAgency node, and > choose New > Entity Classes from Database. > # Select New Data Source from the Data Source drop-down list to open the > Create Data Source dialog. > # Type jdbc/consult as the JNDI Name and select jdbc:derby:// > localhost:1527/consult [consult on CONSULT] as the Database Connection. > Click OK to close the dialog box and return to the wizard. > > http://www.netbeans.org/kb/61/web/jsf-jpa-crud-wizard.html#03 > > However, I know nothing beyond wikipedia about JNDI > > What do I enter in the JNDI field? This seems to lead into EJB > territory, which I'll stay out of for the time being. > > I tried entering jdbc/myWebApp as the JNDI name, which sorta-kinda worked. > This allowed me to see some tables. (Some were tables were greyed out > an unknown reason.) I think that wizard is EJB specific. You can use JPA in non-EJB context though. See: http://en.wikibooks.org/wiki/Java_Persistence/Runtime#Java_Standard_Edition Arne --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [prev] | [next] | [standalone]
| From | "Thufir" <thufir@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:23 +0000 |
| Subject | Re: Generating the Entity |
| Message-ID | <gnmSk.3532$Gm3.3492@newsfe01.iad> |
| In reply to | #340 |
To: comp.lang.java.databases On Mon, 10 Nov 2008 21:23:30 -0500, Arne Vajh|+j wrote: > I think that wizard is EJB specific. > > You can use JPA in non-EJB context though. > > See: > > http://en.wikibooks.org/wiki/Java_Persistence/ Runtime#Java_Standard_Edition I'll read up, however it seems a bit of a daunting task. Any pointers? Perhaps I'm not asking the right question(s)? thanks, Thufir --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [prev] | [next] | [standalone]
| From | "=?UTF-8?B?QXJuZSBWYWpow7h" <=?utf-8?b?qxjuzsbwywpow7h@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:23 +0000 |
| Subject | Re: Generating the Entity |
| Message-ID | <4919fd3f$0$90274$14726298@news.sunsite.dk> |
| In reply to | #341 |
To: comp.lang.java.databases Thufir wrote: > On Mon, 10 Nov 2008 21:23:30 -0500, Arne Vajh|+j wrote: > > >> I think that wizard is EJB specific. >> >> You can use JPA in non-EJB context though. >> >> See: >> >> http://en.wikibooks.org/wiki/Java_Persistence/Runtime#Java_Standard_Edition > > I'll read up, however it seems a bit of a daunting task. Any pointers? > Perhaps I'm not asking the right question(s)? The example looks simple to me. Arne --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [prev] | [next] | [standalone]
| From | "Lew" <lew@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:23 +0000 |
| Subject | Re: Generating the Entity |
| Message-ID | <gfd7jt$o8q$1@aioe.org> |
| In reply to | #342 |
To: comp.lang.java.databases Arne Vajh|+j wrote: > Thufir wrote: >> On Mon, 10 Nov 2008 21:23:30 -0500, Arne Vajh|+j wrote: >> >> >>> I think that wizard is EJB specific. >>> >>> You can use JPA in non-EJB context though. >>> >>> See: >>> >>> http://en.wikibooks.org/wiki/Java_Persistence/Runtime#Java_Standard_Edition >>> >> >> I'll read up, however it seems a bit of a daunting task. Any >> pointers? Perhaps I'm not asking the right question(s)? > > The example looks simple to me. I've been studying JPA for a while, and it is a bit of a bear to set up, but not really very difficult. You set up an XML file to define a data source, defining the JNDI name as the glue between the different parts of the application. Then you annotate the entity classes, throw in an EntityManager and Bob's your uncle. -- Lew --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [prev] | [next] | [standalone]
| From | "=?UTF-8?B?QXJuZSBWYWpow7h" <=?utf-8?b?qxjuzsbwywpow7h@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:23 +0000 |
| Subject | Re: Generating the Entity |
| Message-ID | <491a3788$0$90273$14726298@news.sunsite.dk> |
| In reply to | #343 |
To: comp.lang.java.databases Lew wrote: > Arne Vajh|+j wrote: >> Thufir wrote: >>> On Mon, 10 Nov 2008 21:23:30 -0500, Arne Vajh|+j wrote: >>>> I think that wizard is EJB specific. >>>> >>>> You can use JPA in non-EJB context though. >>>> >>>> See: >>>> >>>> http://en.wikibooks.org/wiki/Java_Persistence/Runtime#Java_Standard_Edition >>>> >>> >>> I'll read up, however it seems a bit of a daunting task. Any >>> pointers? Perhaps I'm not asking the right question(s)? >> >> The example looks simple to me. > > I've been studying JPA for a while, and it is a bit of a bear to set up, > but not really very difficult. You set up an XML file to define a data > source, defining the JNDI name as the glue between the different parts > of the application. Then you annotate the entity classes, throw in an > EntityManager and Bob's your uncle. Except that in Java SE context you do not use JNDI. Which was what this thread started with. Arne --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.databases
csiph-web