<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>DaniWeb IT Discussion Community</title>
		<link>http://www.daniweb.com/forums/</link>
		<description>Tech support, programming, web development, and internet marketing community. Forums to get free computer help and support.</description>
		<language>en-US</language>
		<lastBuildDate>Tue, 08 Dec 2009 11:42:23 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.daniweb.com/alphaimages/misc/rss.jpg</url>
			<title>DaniWeb IT Discussion Community</title>
			<link>http://www.daniweb.com/forums/</link>
		</image>
		<item>
			<title>jsf_book_recommendation</title>
			<link>http://www.daniweb.com/forums/thread242763.html</link>
			<pubDate>Tue, 01 Dec 2009 13:33:33 GMT</pubDate>
			<description>The name of this question is jsf_book_recommendation 
Hello and Thank you in advance for any assistance. 
 
 *  
System info: 
* 
I use Netbeans,MySQL,glassfish 
 *  
The Purpose of this post is: 
*</description>
			<content:encoded><![CDATA[<div>The name of this question is jsf_book_recommendation<br />
Hello and Thank you in advance for any assistance.<br />
<br />
 <span style="font-weight:bold"> <br />
System info:<br />
</span><br />
I use Netbeans,MySQL,glassfish<br />
 <span style="font-weight:bold"> <br />
The Purpose of this post is:<br />
</span><br />
To see if any one has a good recommendation for a book to study JSF web app building. Preferably something that get into accessing databases.<br />
Thanks again.<br />
-ceyesumma</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum24.html">JSP</category>
			<dc:creator>ceyesuma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread242763.html</guid>
		</item>
		<item>
			<title>three JSF questions and (related to Oracle)</title>
			<link>http://www.daniweb.com/forums/thread239480.html</link>
			<pubDate>Wed, 18 Nov 2009 15:16:04 GMT</pubDate>
			<description>The name of this question is “three JSF questions” 
Hello and Thank you in advance for any assistance. 
 
 *  
System info: 
* 
Netbeans,MySQL,glassfish 
 *  
The Purpose of this post is: 
*</description>
			<content:encoded><![CDATA[<div>The name of this question is “three JSF questions”<br />
Hello and Thank you in advance for any assistance.<br />
<br />
 <span style="font-weight:bold"> <br />
System info:<br />
</span><br />
Netbeans,MySQL,glassfish<br />
 <span style="font-weight:bold"> <br />
The Purpose of this post is:<br />
</span><br />
have someone look at the excel file (subscribe_app_notes2)at :<br />
<br />
<a rel="nofollow" class="t" href="http://cid-b5cb457363230793.skydrive.live.com/browse.aspx/Public" target="_blank">http://cid-b5cb457363230793.skydrive...se.aspx/Public</a><br />
<br />
 <span style="font-weight:bold"><br />
The functionality of this code is:<br />
</span><br />
I have the whole package I am creating (pseudo code) stated there along with 3 questions I am presently trying to figure out.<br />
 <span style="font-weight:bold"><br />
My question is: <br />
</span> <br />
<br />
One: I am using MySQL and the tutorial I am studying uses Oracle so I need to resolve the resource tag?<br />
<br />
Two: My web.xml is different from the one presented in the tutorial.  Could someone point out what needs to be added or changed to get it to work with my project?<br />
<br />
Three: One of my classes (TopLinkSubscriberDAO.java) is using imports related to Oracle.  I am exploring oracle to resolve this.  Is anyone able to explain how to resolve errors in this class?<br />
<span style="font-weight:bold"><br />
The errors related to this code are:<br />
</span><br />
 <span style="font-weight:bold"><br />
Code description: <br />
</span><br />
 <pre style="margin:20px; line-height:13px"></pre>Thanks again.<br />
-ceyesumma <br />
 <span style="font-weight:bold"><br />
Note: If you are note willing to look at the exel file that is understandable.  I just use it to present every single aspect of the project I am trying to build.<br />
</span> ………………………………………………………………………………………………<br />
 <span style="font-weight:bold"><br />
Code description <br />
</span><br />
 <pre style="margin:20px; line-height:13px"></pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum24.html">JSP</category>
			<dc:creator>ceyesuma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239480.html</guid>
		</item>
		<item>
			<title>seperating model from view in jsf</title>
			<link>http://www.daniweb.com/forums/thread239186.html</link>
			<pubDate>Tue, 17 Nov 2009 11:51:27 GMT</pubDate>
			<description>The name of this question is seperatin_view_model 
Hello and Thank you in advance for any assistance. 
 
 *  
System info: 
* 
Netbeans,MySql,glassfish,   
 *  
The Purpose of this post is: 
*</description>
			<content:encoded><![CDATA[<div>The name of this question is seperatin_view_model<br />
Hello and Thank you in advance for any assistance.<br />
<br />
 <span style="font-weight:bold"> <br />
System info:<br />
</span><br />
Netbeans,MySql,glassfish,  <br />
 <span style="font-weight:bold"> <br />
The Purpose of this post is:<br />
</span><br />
to have someone look at my exel file where my question concerning packaging,and beans and faces-conf.xml and the concept of seperation of view and model concept<br />
 <span style="font-weight:bold"><br />
The functionality of this code is:<br />
</span><br />
I am building an exel file with the package structure and adding classes etc along with notes so I can build my app in netbeans and keep track of all it complexitities.<br />
 <span style="font-weight:bold"><br />
My question is: <br />
</span> <br />
the question is in the exel file at:<br />
<a rel="nofollow" class="t" href="http://cid-b5cb457363230793.skydrive.live.com/browse.aspx/Public" target="_blank">http://cid-b5cb457363230793.skydrive...se.aspx/Public</a><br />
<br />
(the first one is exel.xls and the second is exel.xlsx)<br />
<span style="font-weight:bold"><br />
The errors related to this code are:<br />
</span><br />
 <span style="font-weight:bold"><br />
Code description: <br />
</span><br />
 <pre style="margin:20px; line-height:13px"></pre>Thanks again.<br />
-ceyesumma <br />
 <span style="font-weight:bold"><br />
Note:<br />
</span> <br />
a simple yes or no is sufficient.  I just want to see if I understand the concept because the total app (at the link below is using Oracle which I will have to change and it is complicated to say the least.<br />
<br />
<a rel="nofollow" class="t" href="http://www.oracle.com/technology/pub/articles/cioroianu_jsfdb.htm" target="_blank">http://www.oracle.com/technology/pub...ianu_jsfdb.htm</a><br />
………………………………………………………………………………………………<br />
 <span style="font-weight:bold"><br />
Code description <br />
</span><br />
 <pre style="margin:20px; line-height:13px"></pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum24.html">JSP</category>
			<dc:creator>ceyesuma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239186.html</guid>
		</item>
		<item>
			<title>Netbeans and oracle</title>
			<link>http://www.daniweb.com/forums/thread238845.html</link>
			<pubDate>Mon, 16 Nov 2009 06:19:53 GMT</pubDate>
			<description>The name of this question is oracle project 
Hello and Thank you in advance for any assistance. 
 
 *  
System info:  
* 
I presently use Netbeans6.7,MySQL,glassfish to work with learning JSF  and java apps etc. 
 
 *  
The Purpose of this post is:</description>
			<content:encoded><![CDATA[<div>The name of this question is oracle project<br />
Hello and Thank you in advance for any assistance.<br />
<br />
 <span style="font-weight:bold"> <br />
System info: <br />
</span><br />
I presently use Netbeans6.7,MySQL,glassfish to work with learning JSF  and java apps etc.<br />
<br />
 <span style="font-weight:bold"> <br />
The Purpose of this post is: <br />
</span><br />
I recently was presented with a tutorial to learn JSF and databases.  It uses Oracle stuff.<br />
(Ex)<br />
Creating the TopLink Project The following instructions describe how to create a TopLink project using the Mapping Workbench. <br />
Step 1: Launch OracleAS TopLink Mapping Workbench. Then, select File and New Project... from the main menu. In the Create New Project dialog, provide the name of an existing database (e.g. orcl) and click<br />
 <span style="font-weight:bold"><br />
The functionality of this code is:<br />
</span><br />
 <span style="font-weight:bold"><br />
My question is: <br />
</span> <br />
Is there any one familiar with this “OraclAS TopLink” program ?  Can I just add it to what Im using now (listed above) ?  It seems as if this program could use my MySQL databases and my programs written with Netbeans using glassfish and it will allow me to work with oracle toplink  to make the database work with the class files. <br />
<br />
Is this even close?<br />
<span style="font-weight:bold"><br />
The errors related to this code are:<br />
</span><br />
 <span style="font-weight:bold"><br />
Code description: <br />
</span><br />
 <pre style="margin:20px; line-height:13px"></pre>Thanks again.<br />
-ceyesumma <br />
 <span style="font-weight:bold"><br />
Note:<br />
</span> ………………………………………………………………………………………………<br />
 <span style="font-weight:bold"><br />
Code description <br />
</span><br />
 <pre style="margin:20px; line-height:13px"></pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum129.html">Oracle</category>
			<dc:creator>ceyesuma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread238845.html</guid>
		</item>
		<item>
			<title>my first jsf app</title>
			<link>http://www.daniweb.com/forums/thread238222.html</link>
			<pubDate>Fri, 13 Nov 2009 07:29:26 GMT</pubDate>
			<description>The name of this question is 
Hello and Thank you in advance for any assistance. 
 
 *  
System info: 
* 
JSF,netbeans6.7 
 *  
The Purpose of this post is: 
*</description>
			<content:encoded><![CDATA[<div>The name of this question is<br />
Hello and Thank you in advance for any assistance.<br />
<br />
 <span style="font-weight:bold"> <br />
System info:<br />
</span><br />
JSF,netbeans6.7<br />
 <span style="font-weight:bold"> <br />
The Purpose of this post is:<br />
</span><br />
My first successful JSF app.  If someone wants to check it out.<br />
Found at:<br />
<a rel="nofollow" class="t" href="http://cid-b5cb457363230793.skydrive.live.com/self.aspx/.Public/guessNumber.zip" target="_blank">http://cid-b5cb457363230793.skydrive...uessNumber.zip</a><br />
 <span style="font-weight:bold"><br />
The functionality of this code is:<br />
</span><br />
program(jsf app from tutorial ejb) GuessNumber .  simple random number guess.<br />
 <span style="font-weight:bold"><br />
My question is: <br />
</span> <br />
If anyone has a good example for JSF and databases I’d like to see it. thanks<br />
<span style="font-weight:bold"><br />
The errors related to this code are:<br />
</span><br />
 [B]<br />
none<br />
Thanks again.<br />
-ceyesumma <br />
 <span style="font-weight:bold"><br />
Note:<br />
</span> ………………………………………………………………………………………………</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum24.html">JSP</category>
			<dc:creator>ceyesuma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread238222.html</guid>
		</item>
		<item>
			<title><![CDATA[jsf navigation&database connection]]></title>
			<link>http://www.daniweb.com/forums/thread228739.html</link>
			<pubDate>Fri, 09 Oct 2009 03:42:57 GMT</pubDate>
			<description>Topic 
The topic of this question is: JSF_navigation and database connection 
Hello and Thank you in advance for any assistance. 
 
 * 
System info: 
* 
Netbeans6.7.1,jsf1.2,two MySQL databases.(one for login one for searches) 
 
 *</description>
			<content:encoded><![CDATA[<div>Topic<br />
The topic of this question is: JSF_navigation and database connection<br />
Hello and Thank you in advance for any assistance.<br />
<br />
 <span style="font-weight:bold"><br />
System info:<br />
</span><br />
Netbeans6.7.1,jsf1.2,two MySQL databases.(one for login one for searches)<br />
<br />
 <span style="font-weight:bold"><br />
The purpose of this post is: <br />
</span><br />
Try to get the login jsp to switch to the next page and understand how to connect to the database to simulate a login .<br />
<br />
<br />
 <span style="font-weight:bold"><br />
The functionality of this code is:  <br />
</span><br />
I have two databases one for login and one for finding contents of several music book records. Searches performed via artist or song. The first order of operation is Login.jsp which submits the user name “uid” (user Name and password are the same) and are validated simple uid&gt;8 characters. Upon login the login.jsf page should navigate to the success.jsp or fail.jsp via faces-config file . The login.jsp submits to the controller, the controller calls the model to validate and connect to the splashbookdb_user database. that’s all for now.<br />
(the design of the code does absolutely nothing now.  I just can’t get the connection worked out.) <br />
<br />
(jsf pages,SplashbookController.java,SplashbookModel.java and Content.java (entity).<br />
<br />
<span style="font-weight:bold">I will be updating the splashbook project periodically at:</span><br />
<a rel="nofollow" class="t" href="http://cid-b5cb457363230793.skydrive.live.com/self.aspx/.Public/splashbookdb^_and^_netbeans^_project%20-%20Copy.zip" target="_blank">http://cid-b5cb457363230793.skydrive...20-%20Copy.zip</a><br />
<span style="font-weight:bold"><br />
The errors related to this code are:<br />
</span><br />
<br />
<br />
<span style="font-weight:bold"><br />
Error description: Mozilla firefox<br />
</span><br />
 <pre style="margin:20px; line-height:13px">------------<br />
<br />
HTTP Status 500 -<br />
<br />
type Exception report<br />
<br />
message<br />
<br />
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.<br />
<br />
exception<br />
<br />
javax.servlet.ServletException: #{SplashbookController.ValidateUser}: java.lang.NullPointerException<br />
<br />
root cause<br />
<br />
javax.faces.FacesException: #{SplashbookController.ValidateUser}: java.lang.NullPointerException<br />
<br />
root cause<br />
<br />
javax.faces.el.EvaluationException: java.lang.NullPointerException<br />
<br />
root cause<br />
<br />
java.lang.NullPointerException<br />
<br />
note The full stack traces of the exception and its root causes are available in the Sun GlassFish Enterprise Server v2.1 logs.</pre><br />
<br />
<span style="font-weight:bold"><br />
Code description:faces-config.xml<br />
</span><br />
 <pre style="margin:20px; line-height:13px">&lt;?xml version='1.0' encoding='UTF-8'?&gt;<br />
<br />
&lt;!-- =========== FULL CONFIGURATION FILE ================================== --&gt;<br />
<br />
&lt;faces-config version=&quot;1.2&quot; <br />
&nbsp; &nbsp; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; <br />
&nbsp; &nbsp; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; <br />
&nbsp; &nbsp; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&quot;&gt;<br />
&nbsp; &nbsp; &lt;managed-bean&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;managed-bean-name&gt;SplashbookController&lt;/managed-bean-name&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;managed-bean-class&gt;controllers.SplashbookController&lt;/managed-bean-class&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;managed-bean-scope&gt;request&lt;/managed-bean-scope&gt;<br />
&nbsp; &nbsp; &lt;/managed-bean&gt;<br />
&nbsp; &nbsp; &lt;navigation-rule&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;from-view-id&gt;/login.jsp&lt;/from-view-id&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;navigation-case&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;from-outcome&gt;success&lt;/from-outcome&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;to-view-id&gt;/loginSuccess.jsp&lt;/to-view-id&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/navigation-case&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;navigation-case&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;from-outcome&gt;fail&lt;/from-outcome&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;to-view-id&gt;/loginFail.jsp&lt;/to-view-id&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/navigation-case&gt;<br />
&nbsp; &nbsp; &lt;/navigation-rule&gt;<br />
<br />
&lt;/faces-config&gt;</pre><br />
<br />
<span style="font-weight:bold"><br />
Code description:login.jsp<br />
</span><br />
 <pre style="margin:20px; line-height:13px">&lt;%-- <br />
&nbsp; &nbsp; Document&nbsp;  : login<br />
&nbsp; &nbsp; Created on : Oct 7, 2009, 8:45:20 PM<br />
&nbsp; &nbsp; Author&nbsp; &nbsp;  : depot<br />
--%&gt;<br />
<br />
&lt;%@page contentType=&quot;text/html&quot; pageEncoding=&quot;UTF-8&quot;%&gt;<br />
<br />
&lt;%@taglib prefix=&quot;f&quot; uri=&quot;http://java.sun.com/jsf/core&quot;%&gt;<br />
&lt;%@taglib prefix=&quot;h&quot; uri=&quot;http://java.sun.com/jsf/html&quot;%&gt;<br />
<br />
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;<br />
&nbsp; &nbsp; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;<br />
<br />
&lt;f:view&gt;<br />
&nbsp; &nbsp; &lt;html&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;head&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;title&gt;splashbook Login Page&lt;/title&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/style1.css&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/head&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;body&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h1&gt;&lt;h:outputText value=&quot;username=student1&quot;/&gt;&lt;/h1&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h1&gt;&lt;h:outputText value=&quot;password= student1&quot;/&gt;&lt;/h1&gt;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h:form id=&quot;LoginApplication&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h:panelGrid id=&quot;loginPanel&quot; columns=&quot;2&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h:outputText value=&quot;user ID&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h:inputText id=&quot;loginId&quot; value=&quot;#{SplashbookController.uid}&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h:outputText value=&quot;Password&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h:inputSecret id=&quot;password&quot;&nbsp; value=&quot;#{SplashbookController.password}&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h:outputText value=&quot;&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;h:commandButton value=&quot;login&quot; action =&quot;#{SplashbookController.ValidateUser}&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/h:panelGrid&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/h:form&gt;<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/body&gt;<br />
&nbsp; &nbsp; &lt;/html&gt;<br />
&lt;/f:view&gt;</pre><br />
<br />
<br />
<span style="font-weight:bold"><br />
Code description:SplashBookController.java<br />
</span><br />
 <pre style="margin:20px; line-height:13px">/*<br />
&nbsp;* To change this template, choose Tools | Templates<br />
&nbsp;* and open the template in the editor.<br />
&nbsp;*/<br />
package controllers;<br />
<br />
/**<br />
&nbsp;*<br />
&nbsp;* @author depot<br />
&nbsp;*/<br />
import classes.SplashbookModel;<br />
import entities.Content;<br />
<br />
import java.sql.Connection;<br />
<br />
public class SplashbookController {<br />
<br />
&nbsp; &nbsp; public SplashbookModel splashbookModel;<br />
&nbsp; &nbsp; public String uid;<br />
&nbsp; &nbsp; public String password;<br />
&nbsp; &nbsp; public String database;<br />
&nbsp;  <br />
&nbsp; &nbsp; public int uidLength = 8;<br />
&nbsp; &nbsp; public String loginResult;<br />
&nbsp; &nbsp; public Connection conn;<br />
<br />
&nbsp; &nbsp; /** Creates a new instance of SplashbookController */<br />
&nbsp; &nbsp; public SplashbookController() {<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String ValidateUser() throws Exception {<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (uid.length() &gt;= 8) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; database=&quot;splashbookdb_user&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;database name--------------&gt;&quot;+database+&quot;&lt;-------------------&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; splashbookModel.connectToUserDB(database);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(splashbookModel.getConn().equals(null)){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loginResult=&quot;fail&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }else{<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loginResult=&quot;success&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;loginResult--------------&gt;&quot;+loginResult+&quot;&lt;-------------------&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return loginResult;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; public String getLoginResult() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return loginResult;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setLoginResult(String loginResult) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.loginResult = loginResult;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getPassword() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return password;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setPassword(String password) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.password = password;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getUid() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return uid;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setUid(String uid) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.uid = uid;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public int getUidLength() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return uidLength;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setUidLength(int uidLength) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.uidLength = uidLength;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp;  <br />
}</pre><br />
<span style="font-weight:bold"><br />
Code description:SplashbookModel.java<br />
</span><br />
 <pre style="margin:20px; line-height:13px">/*<br />
&nbsp;* To change this template, choose Tools | Templates<br />
&nbsp;* and open the template in the editor.<br />
&nbsp;*/<br />
<br />
package classes;<br />
<br />
/**<br />
&nbsp;*<br />
&nbsp;* @author depot<br />
&nbsp;*/<br />
import controllers.SplashbookController;<br />
import entities.Content;<br />
import java.sql.Connection;<br />
import java.sql.DriverManager;<br />
public class SplashbookModel {<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; public Connection conn=null;<br />
&nbsp; &nbsp; &nbsp; &nbsp; public StringBuffer buff=null;<br />
&nbsp; &nbsp; &nbsp; &nbsp; public String host=&quot;localhost&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; public String database;<br />
&nbsp; &nbsp; &nbsp; &nbsp; public String dbUserName=&quot;root&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; public String dbPassword=&quot;ceyesuma&quot;;<br />
&nbsp; &nbsp; &nbsp;  <br />
&nbsp;  <br />
public SplashbookModel(){<br />
<br />
}<br />
<br />
<br />
&nbsp;  public Connection connectToUserDB(String database)throws Exception {<br />
&nbsp; &nbsp; &nbsp;  System.out.println(&quot;splashbookModel.connectToUserDB()--------------&gt;&quot;+database+&quot;&lt;-------------------&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; try {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff = new StringBuffer();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.append(&quot;jdbc:mysql://&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.append(host);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.append(&quot;/&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.append(database);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.append(&quot;?user=&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.append(dbUserName);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.append(&quot;&amp;password=&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.append(dbPassword);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Class.forName(&quot;com.mysql.jdbc.Driver&quot;).newInstance();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conn = DriverManager.getConnection(buff.toString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;Connection URL: -----------------&gt;&quot; + buff+&quot;&lt;-----------------&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; } catch (Exception ex) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw new Exception(&quot;An error occurred while attempting to connect to[&quot; + buff + &quot;]&quot;);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; return conn;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getDatabase() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return database;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setDatabase(String database) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.database = database;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getDbPassword() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return dbPassword;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setDbPassword(String dbPassword) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.dbPassword = dbPassword;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getDbUserName() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return dbUserName;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setDbUserName(String dbUserName) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.dbUserName = dbUserName;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getHost() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return host;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setHost(String host) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.host = host;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public StringBuffer getBuff() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return buff;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setBuff(StringBuffer buff) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.buff = buff;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public Connection getConn() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return conn;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setConn(Connection conn) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.conn = conn;<br />
&nbsp; &nbsp; }<br />
&nbsp;  <br />
&nbsp;<br />
<br />
}</pre><span style="font-weight:bold"><br />
The Entities from db’s related to this code are:<br />
</span><br />
User.java used to log in.<br />
Usergroup.java used to log in and specify permissions.<br />
Content.java used for searching.<br />
<br />
<span style="font-weight:bold"><br />
Code description:Content<br />
</span><br />
 <pre style="margin:20px; line-height:13px">/*<br />
&nbsp;* To change this template, choose Tools | Templates<br />
&nbsp;* and open the template in the editor.<br />
&nbsp;*/<br />
<br />
package entities;<br />
<br />
import java.io.Serializable;<br />
import javax.persistence.Basic;<br />
import javax.persistence.Column;<br />
import javax.persistence.Entity;<br />
import javax.persistence.GeneratedValue;<br />
import javax.persistence.GenerationType;<br />
import javax.persistence.Id;<br />
import javax.persistence.NamedQueries;<br />
import javax.persistence.NamedQuery;<br />
import javax.persistence.Table;<br />
<br />
/**<br />
&nbsp;*<br />
&nbsp;* @author depot<br />
&nbsp;*/<br />
@Entity<br />
@Table(name = &quot;content&quot;)<br />
@NamedQueries({@NamedQuery(name = &quot;Content.findAll&quot;, query = &quot;SELECT c FROM Content c&quot;), @NamedQuery(name = &quot;Content.findById&quot;, query = &quot;SELECT c FROM Content c WHERE c.id = :id&quot;), @NamedQuery(name = &quot;Content.findByPublisherCode&quot;, query = &quot;SELECT c FROM Content c WHERE c.publisherCode = :publisherCode&quot;), @NamedQuery(name = &quot;Content.findByBookIsbn&quot;, query = &quot;SELECT c FROM Content c WHERE c.bookIsbn = :bookIsbn&quot;), @NamedQuery(name = &quot;Content.findByBookTitle&quot;, query = &quot;SELECT c FROM Content c WHERE c.bookTitle = :bookTitle&quot;), @NamedQuery(name = &quot;Content.findByArtist&quot;, query = &quot;SELECT c FROM Content c WHERE c.artist = :artist&quot;), @NamedQuery(name = &quot;Content.findBySong&quot;, query = &quot;SELECT c FROM Content c WHERE c.song = :song&quot;), @NamedQuery(name = &quot;Content.findByPageNum&quot;, query = &quot;SELECT c FROM Content c WHERE c.pageNum = :pageNum&quot;)})<br />
public class Content implements Serializable {<br />
&nbsp; &nbsp; private static final long serialVersionUID = 1L;<br />
&nbsp; &nbsp; @Id<br />
&nbsp; &nbsp; @GeneratedValue(strategy = GenerationType.IDENTITY)<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;id&quot;)<br />
&nbsp; &nbsp; private Integer id;<br />
&nbsp; &nbsp; @Column(name = &quot;publisher_code&quot;)<br />
&nbsp; &nbsp; private String publisherCode;<br />
&nbsp; &nbsp; @Column(name = &quot;book_isbn&quot;)<br />
&nbsp; &nbsp; private String bookIsbn;<br />
&nbsp; &nbsp; @Column(name = &quot;book_title&quot;)<br />
&nbsp; &nbsp; private String bookTitle;<br />
&nbsp; &nbsp; @Column(name = &quot;artist&quot;)<br />
&nbsp; &nbsp; private String artist;<br />
&nbsp; &nbsp; @Column(name = &quot;song&quot;)<br />
&nbsp; &nbsp; private String song;<br />
&nbsp; &nbsp; @Column(name = &quot;page_num&quot;)<br />
&nbsp; &nbsp; private Integer pageNum;<br />
<br />
&nbsp; &nbsp; public Content() {<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public Content(Integer id) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.id = id;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public Integer getId() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return id;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setId(Integer id) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.id = id;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getPublisherCode() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return publisherCode;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setPublisherCode(String publisherCode) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.publisherCode = publisherCode;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getBookIsbn() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return bookIsbn;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setBookIsbn(String bookIsbn) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.bookIsbn = bookIsbn;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getBookTitle() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return bookTitle;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setBookTitle(String bookTitle) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.bookTitle = bookTitle;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getArtist() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return artist;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setArtist(String artist) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.artist = artist;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getSong() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return song;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setSong(String song) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.song = song;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public Integer getPageNum() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return pageNum;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setPageNum(Integer pageNum) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.pageNum = pageNum;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; public int hashCode() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; int hash = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; hash += (id != null ? id.hashCode() : 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; return hash;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; public boolean equals(Object object) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; // TODO: Warning - this method won't work in the case the id fields are not set<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (!(object instanceof Content)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; Content other = (Content) object;<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ((this.id == null &amp;&amp; other.id != null) || (this.id != null &amp;&amp; !this.id.equals(other.id))) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; return true;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; public String toString() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return &quot;entities.Content[id=&quot; + id + &quot;]&quot;;<br />
&nbsp; &nbsp; }<br />
<br />
}</pre><br />
<span style="font-weight:bold"><br />
Code description:User.java(entity)<br />
</span><br />
 <pre style="margin:20px; line-height:13px">/*<br />
&nbsp;* To change this template, choose Tools | Templates<br />
&nbsp;* and open the template in the editor.<br />
&nbsp;*/<br />
<br />
package entities;<br />
<br />
import java.io.Serializable;<br />
import java.util.Collection;<br />
import javax.persistence.Basic;<br />
import javax.persistence.Column;<br />
import javax.persistence.Entity;<br />
import javax.persistence.Id;<br />
import javax.persistence.ManyToMany;<br />
import javax.persistence.NamedQueries;<br />
import javax.persistence.NamedQuery;<br />
import javax.persistence.Table;<br />
<br />
/**<br />
&nbsp;*<br />
&nbsp;* @author depot<br />
&nbsp;*/<br />
@Entity<br />
@Table(name = &quot;user&quot;)<br />
@NamedQueries({@NamedQuery(name = &quot;User.findAll&quot;, query = &quot;SELECT u FROM User u&quot;), @NamedQuery(name = &quot;User.findByUid&quot;, query = &quot;SELECT u FROM User u WHERE u.uid = :uid&quot;), @NamedQuery(name = &quot;User.findByPassword&quot;, query = &quot;SELECT u FROM User u WHERE u.password = :password&quot;), @NamedQuery(name = &quot;User.findByFirstName&quot;, query = &quot;SELECT u FROM User u WHERE u.firstName = :firstName&quot;), @NamedQuery(name = &quot;User.findByLastName&quot;, query = &quot;SELECT u FROM User u WHERE u.lastName = :lastName&quot;), @NamedQuery(name = &quot;User.findByAddress1&quot;, query = &quot;SELECT u FROM User u WHERE u.address1 = :address1&quot;), @NamedQuery(name = &quot;User.findByAddress2&quot;, query = &quot;SELECT u FROM User u WHERE u.address2 = :address2&quot;), @NamedQuery(name = &quot;User.findByCity&quot;, query = &quot;SELECT u FROM User u WHERE u.city = :city&quot;), @NamedQuery(name = &quot;User.findByPostCode&quot;, query = &quot;SELECT u FROM User u WHERE u.postCode = :postCode&quot;), @NamedQuery(name = &quot;User.findByEmail&quot;, query = &quot;SELECT u FROM User u WHERE u.email = :email&quot;), @NamedQuery(name = &quot;User.findByPhone&quot;, query = &quot;SELECT u FROM User u WHERE u.phone = :phone&quot;), @NamedQuery(name = &quot;User.findByUserGroup&quot;, query = &quot;SELECT u FROM User u WHERE u.userGroup = :userGroup&quot;)})<br />
public class User implements Serializable {<br />
&nbsp; &nbsp; private static final long serialVersionUID = 1L;<br />
&nbsp; &nbsp; @Id<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;uid&quot;)<br />
&nbsp; &nbsp; private String uid;<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;password&quot;)<br />
&nbsp; &nbsp; private String password;<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;firstName&quot;)<br />
&nbsp; &nbsp; private String firstName;<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;lastName&quot;)<br />
&nbsp; &nbsp; private String lastName;<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;address1&quot;)<br />
&nbsp; &nbsp; private String address1;<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;address2&quot;)<br />
&nbsp; &nbsp; private String address2;<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;city&quot;)<br />
&nbsp; &nbsp; private String city;<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;postCode&quot;)<br />
&nbsp; &nbsp; private String postCode;<br />
&nbsp; &nbsp; @Column(name = &quot;email&quot;)<br />
&nbsp; &nbsp; private String email;<br />
&nbsp; &nbsp; @Column(name = &quot;phone&quot;)<br />
&nbsp; &nbsp; private Integer phone;<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;userGroup&quot;)<br />
&nbsp; &nbsp; private String userGroup;<br />
&nbsp; &nbsp; @ManyToMany(mappedBy = &quot;userCollection&quot;)<br />
&nbsp; &nbsp; private Collection&lt;Usergroup&gt; usergroupCollection;<br />
<br />
&nbsp; &nbsp; public User() {<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public User(String uid) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.uid = uid;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public User(String uid, String password, String firstName, String lastName, String address1, String address2, String city, String postCode, String userGroup) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.uid = uid;<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.password = password;<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.firstName = firstName;<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.lastName = lastName;<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.address1 = address1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.address2 = address2;<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.city = city;<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.postCode = postCode;<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.userGroup = userGroup;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getUid() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return uid;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setUid(String uid) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.uid = uid;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getPassword() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return password;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setPassword(String password) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.password = password;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getFirstName() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return firstName;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setFirstName(String firstName) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.firstName = firstName;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getLastName() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return lastName;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setLastName(String lastName) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.lastName = lastName;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getAddress1() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return address1;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setAddress1(String address1) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.address1 = address1;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getAddress2() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return address2;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setAddress2(String address2) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.address2 = address2;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getCity() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return city;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setCity(String city) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.city = city;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getPostCode() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return postCode;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setPostCode(String postCode) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.postCode = postCode;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getEmail() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return email;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setEmail(String email) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.email = email;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public Integer getPhone() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return phone;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setPhone(Integer phone) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.phone = phone;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getUserGroup() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return userGroup;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setUserGroup(String userGroup) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.userGroup = userGroup;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public Collection&lt;Usergroup&gt; getUsergroupCollection() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return usergroupCollection;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setUsergroupCollection(Collection&lt;Usergroup&gt; usergroupCollection) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.usergroupCollection = usergroupCollection;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; public int hashCode() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; int hash = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; hash += (uid != null ? uid.hashCode() : 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; return hash;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; public boolean equals(Object object) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; // TODO: Warning - this method won't work in the case the id fields are not set<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (!(object instanceof User)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; User other = (User) object;<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ((this.uid == null &amp;&amp; other.uid != null) || (this.uid != null &amp;&amp; !this.uid.equals(other.uid))) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; return true;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; public String toString() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return &quot;entities.User[uid=&quot; + uid + &quot;]&quot;;<br />
&nbsp; &nbsp; }<br />
<br />
}</pre><br />
<span style="font-weight:bold"><br />
Code description:Usergroup.java(Entity class)<br />
</span><br />
 <pre style="margin:20px; line-height:13px">/*<br />
&nbsp;* To change this template, choose Tools | Templates<br />
&nbsp;* and open the template in the editor.<br />
&nbsp;*/<br />
<br />
package entities;<br />
<br />
import java.io.Serializable;<br />
import java.util.Collection;<br />
import javax.persistence.Basic;<br />
import javax.persistence.Column;<br />
import javax.persistence.Entity;<br />
import javax.persistence.Id;<br />
import javax.persistence.JoinColumn;<br />
import javax.persistence.JoinTable;<br />
import javax.persistence.ManyToMany;<br />
import javax.persistence.NamedQueries;<br />
import javax.persistence.NamedQuery;<br />
import javax.persistence.Table;<br />
<br />
/**<br />
&nbsp;*<br />
&nbsp;* @author depot<br />
&nbsp;*/<br />
@Entity<br />
@Table(name = &quot;usergroup&quot;)<br />
@NamedQueries({@NamedQuery(name = &quot;Usergroup.findAll&quot;, query = &quot;SELECT u FROM Usergroup u&quot;), @NamedQuery(name = &quot;Usergroup.findByGroupid&quot;, query = &quot;SELECT u FROM Usergroup u WHERE u.groupid = :groupid&quot;), @NamedQuery(name = &quot;Usergroup.findByGroupName&quot;, query = &quot;SELECT u FROM Usergroup u WHERE u.groupName = :groupName&quot;)})<br />
public class Usergroup implements Serializable {<br />
&nbsp; &nbsp; private static final long serialVersionUID = 1L;<br />
&nbsp; &nbsp; @Id<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;groupid&quot;)<br />
&nbsp; &nbsp; private String groupid;<br />
&nbsp; &nbsp; @Basic(optional = false)<br />
&nbsp; &nbsp; @Column(name = &quot;groupName&quot;)<br />
&nbsp; &nbsp; private String groupName;<br />
&nbsp; &nbsp; @JoinTable(name = &quot;usergroup_mapping&quot;, joinColumns = {@JoinColumn(name = &quot;groupid&quot;, referencedColumnName = &quot;groupid&quot;)}, inverseJoinColumns = {@JoinColumn(name = &quot;uid&quot;, referencedColumnName = &quot;uid&quot;)})<br />
&nbsp; &nbsp; @ManyToMany<br />
&nbsp; &nbsp; private Collection&lt;User&gt; userCollection;<br />
<br />
&nbsp; &nbsp; public Usergroup() {<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public Usergroup(String groupid) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.groupid = groupid;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public Usergroup(String groupid, String groupName) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.groupid = groupid;<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.groupName = groupName;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getGroupid() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return groupid;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setGroupid(String groupid) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.groupid = groupid;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public String getGroupName() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return groupName;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setGroupName(String groupName) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.groupName = groupName;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public Collection&lt;User&gt; getUserCollection() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return userCollection;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; public void setUserCollection(Collection&lt;User&gt; userCollection) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; this.userCollection = userCollection;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; public int hashCode() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; int hash = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; hash += (groupid != null ? groupid.hashCode() : 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; return hash;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; public boolean equals(Object object) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; // TODO: Warning - this method won't work in the case the id fields are not set<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (!(object instanceof Usergroup)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; Usergroup other = (Usergroup) object;<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ((this.groupid == null &amp;&amp; other.groupid != null) || (this.groupid != null &amp;&amp; !this.groupid.equals(other.groupid))) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; return true;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; public String toString() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return &quot;entities.Usergroup[groupid=&quot; + groupid + &quot;]&quot;;<br />
&nbsp; &nbsp; }<br />
<br />
}</pre><br />
<br />
<span style="font-style:italic"><br />
Thanks again.<br />
-ceyesuma<br />
</span><br />
<br />
[u]<br />
 <span style="font-weight:bold"><br />
Note:<br />
</span><br />
________________________________________________________________________<br />
<span style="font-weight:bold"><br />
Code description:<br />
</span><br />
 <pre style="margin:20px; line-height:13px"></pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum24.html">JSP</category>
			<dc:creator>ceyesuma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228739.html</guid>
		</item>
		<item>
			<title><![CDATA[stmt from  db_connect tutorial isn't working]]></title>
			<link>http://www.daniweb.com/forums/thread223601.html</link>
			<pubDate>Wed, 16 Sep 2009 22:45:07 GMT</pubDate>
			<description>Topic 
The topic of this question is: db_Connect does not connect. 
Hello and Thank you in advance for any assistance. 
 
 * 
System info:netbeans project,database attached or provided at: 
http://cid-b5cb457363230793.skydrive.live.com/self.aspx/.Public/school.zip 
* 
 
 *</description>
			<content:encoded><![CDATA[<div>Topic<br />
The topic of this question is: db_Connect does not connect.<br />
Hello and Thank you in advance for any assistance.<br />
<br />
 <span style="font-weight:bold"><br />
System info:netbeans project,database attached or provided at:<br />
<a rel="nofollow" class="t" href="http://cid-b5cb457363230793.skydrive.live.com/self.aspx/.Public/school.zip" target="_blank">http://cid-b5cb457363230793.skydrive...lic/school.zip</a><br />
</span><br />
<br />
 <span style="font-weight:bold"><br />
The purpose of this post is: Try to get a sql statement to work<br />
</span><br />
<br />
 <span style="font-weight:bold"><br />
The functionality of this code is:  <br />
 <pre style="margin:20px; line-height:13px">·&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;SELECT u.uid, firstName, lastName, address1, address2, city, postCode, email, phone, ug.groupName as userGroup &quot;<br />
·&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +&quot;FROM user u, usergroup ug WHERE uid='&quot;+userName+&quot;' AND password='&quot;+password+&quot;' AND groupName IN&quot;<br />
·&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +&quot; (SELECT groupName FROM usergroup WHERE groupid =(SELECT groupid FROM usergroup_mapping WHERE uid=u.uid))&quot;;</pre></span><br />
<br />
 <span style="font-weight:bold"><br />
My question concerning this code is:<br />
What is wrong with the sql statement provided in tutorial. Or a description of its function .<br />
</span><br />
 <br />
<span style="font-weight:bold"><br />
The errors related to this code are:<br />
 <pre style="margin:20px; line-height:13px">Initializing Sun's JavaServer Faces implementation (1.2_04-b22-p05) for context '/school'<br />
Initialize &lt;------------&gt;jdbcDriver&lt;------------&gt;<br />
12345678&lt;------------&gt;12345678<br />
SQLException:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'user u,usergroup ug WHERE uid='12345678' AND password='12345678' AND groupName I' at line 1<br />
Error on DB return<br />
java.lang.NullPointerException<br />
&nbsp; &nbsp; &nbsp; &nbsp; at servlets.LoginServlet.doPost(LoginServlet.java:82)</pre></span><br />
<br />
<span style="font-weight:bold"><br />
Note: <br />
I was told to add table qualifiers to the where clause.<br />
What does this mean.  Maybe if someone could break down what the statement is saying (laymens terms) I could fix it.<br />
</span><br />
<br />
<span style="font-style:italic"><br />
Thanks again.<br />
-ceyesuma<br />
</span></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>ceyesuma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread223601.html</guid>
		</item>
		<item>
			<title>Netbeans ex. of mvc  model 2 db connections</title>
			<link>http://www.daniweb.com/forums/thread222207.html</link>
			<pubDate>Fri, 11 Sep 2009 09:11:21 GMT</pubDate>
			<description>Topic 
The topic of this question is: school_http-Netbeans ex. Of  MVC model 2 db connections 
 
 
Hello and Thank you in advance for any assistance. 
……………………………………………………………………………………………………………………………………………………………………………………………… 
 
System:</description>
			<content:encoded><![CDATA[<div><span style="font-style:italic"><br />
Topic<br />
The topic of this question is: school_http-Netbeans ex. Of  MVC model 2 db connections<br />
</span><br />
 <pre style="margin:20px; line-height:13px">Hello and Thank you in advance for any assistance.</pre>………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
System:<br />
<br />
System info: Netbeans6.7.1,jsf1.2,MySQL <br />
<br />
<br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
Purpose:<br />
<br />
The purpose of this post is: Understand why attached program compiles but after the initial login the server won’t find any .jsp<br />
<br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
Functionality:<br />
<br />
The functionality of this code is:  The tutorial will show simple example of a school login system, where after submitting correct user ID and password user is redirected to the next page in accordance with user group assignment<br />
·	student - will see his personal details<br />
·	teacher - will see his name on the top of the page with table of all students (user ID, first name, last name, email address and phone number)<br />
administrator - will see his name on the top of the page with tables of all teachers and all students (user ID, first name, last name, email address and phone number)<br />
<a rel="nofollow" class="t" href="http://www.daniweb.com/forums/thread141776.html" target="_blank">http://www.daniweb.com/forums/thread141776.html</a>		<br />
the program builds and the index page displays the user Id and password entry but then there are errors.	<br />
<br />
<br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
Question:<br />
<br />
My question concerning this code is: For this program to work.  Is there additional mapping needed in the faces-config.xml file?<br />
<br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
errors:<br />
<br />
The errors related to this code are:<br />
password 12345678 uid 12345678<br />
redirected to: error page.<br />
<br />
HTTP Status 404 -<br />
<br />
type Status report<br />
<br />
message<br />
<br />
<br />
<br />
descriptionThe requested resource () is not available.<br />
Sun GlassFish Enterprise Server v2.1<br />
<br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
errors:<br />
<br />
netbeans build -school(run)<br />
compile-jsps:<br />
Incrementally deploying school_localhost:4848_server<br />
Completed incremental distribution of school<br />
run-deploy:<br />
Browsing:<a rel="nofollow" class="t" href="http://localhost:8080/school/" target="_blank">http://localhost:8080/school/</a><br />
run-display-browser:<br />
run:<br />
BUILD SUCCESSFUL (total time: 6 seconds) <br />
<br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
Description:<br />
<br />
Code description:<br />
<br />
 <pre style="margin:20px; line-height:13px"></pre>………………………………………………………………………………………………………………………………………………………………………………………………<br />
<span style="font-style:italic"><br />
Thanks again.<br />
-ceyesuma<br />
</span><br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
Note:<br />
<br />
Note:<br />
The Program can be found and database can be found at:<br />
<a rel="nofollow" class="t" href="http://cid-b5cb457363230793.skydrive.live.com/self.aspx/.Public/school^_project^_and^_db.zip" target="_blank">http://cid-b5cb457363230793.skydrive...t^_and^_db.zip</a><br />
<br />
named school_project_and_db.zip<br />
<br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
<br />
………………………………………………………………………………………………………………………………………………………………………………………………<br />
<br />
Description:<br />
<br />
Code Description:<br />
<br />
………………………………………………………………………………………………………………………………………………………………………………………………</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum24.html">JSP</category>
			<dc:creator>ceyesuma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread222207.html</guid>
		</item>
	</channel>
</rss>
