ceyezumma -3 Light Poster

Hello all:

Has anyone tried one jar and received an error that the main class will not Load?


I used "ONE JAR" and created the executable and I altered the build file.

response from simon:
Main-Class: com\simontuffs\onejar.Boot One-Jar-Main-Class: musicSystems.src.view.Main

"Main-Class" is the "standard" Java JAR main class launcher, used by "java -jar" to know what to execute. It should point to the com.simontuffs.onejar.Boot class, which then reads the one-jar and launches the class pointed to by "One-Jar-Main-Class" -- your application.

above discribes how the one jar process is working

reads the one-jar and launches the class pointed to by "One-Jar-Main-Class"

This suggest that the build file is not in play. Do I need to do anyThing to
the build file found in the one-jar-sdk-0.97.zip provided?


Below are the command and the build file and errors:


Double clicking the musicSystems.jar that the One Jar produces:

A Java Exception has occurred.

C:\Program Files\Java\jdk1.7.0_01\bin>jar -cvfm C:\Users\Steves\Documents\ceyesu
mma\java_cache\my_projects\netbeans\musicSystems\target_musicSystems\BundlingToo
ls\musicSystems.jar C:\Users\Steves\Documents\ceyesumma\java_cache\my_projects\n
etbeans\musicSystems\target_musicSystems\BundlingTools\META-INF\MANIFEST.MF
added manifest

C:\Program Files\Java\jdk1.7.0_01\bin>jar -tvf C:\Users\Steves\Documents\ceyesum
ma\java_cache\my_projects\netbeans\musicSystems\target_musicSystems\BundlingTool
s\musicSystems.jar
0 Wed Jan 18 08:47:36 CST 2012 META-INF/
304 Wed Jan 18 08:47:36 CST 2012 META-INF/MANIFEST.MF

C:\Program Files\Java\jdk1.7.0_01\bin>java -jar -Xmx256m C:\Users\Steves\Documen
ts\ceyesumma\java_cache\my_projects\netbeans\musicSystems\target_musicSystems\Bu
ndlingTools\musicSystems.jar
Exception in thread "main" java.lang.NullPointerException
at sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:3
99)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:463)


C:\Program Files\Java\jdk1.7.0_01\bin>

Result from command :

Exception in thread "main" java.lang.NullPointerException
        at sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:3
99)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:463) …
ceyezumma -3 Light Poster

Interesting concept. not sure where you are going with it. The solution hfx642
added seems ok to start.
I would like to mention that while you are just getting started with this program.
I have found that if you write several classes to follow you should maintain proper
Code syntax conventions. Meaning that the method names and the variable names
should always maintain the same pattern.

Example:

public StringedInstrument() {
}

should be

stringedInstument(){
}

Where the method starts with lower case and any subsequent word should be upper case.

Same thing with :

String String_Names [] = {"E", "A", "D", "G", "B", "E"};
String string_Names [] = {"E", "A", "D", "G", "B", "E"};
//better yet
String stringNames [] = {"E", "A", "D", "G", "B", "E"};

Also, I am thinking that

you mean:

public void tune() {
		isTuned = !isTuned; 
}

to be:

public void tune() {
		isTuned = false;
 }

or maybe you are testing the variable's value ?

public void tune() {
		//isTuned = !isTuned; 

if(isTuned){

//will do this if isTuned is true.
}
if(!isTuned){

//will do this if isTuned is false.
}

}

As far as my conventions are concerned I always use boolean Variables

boolean bTuned=true;

your method would be more powerfull if it were called and did its thing and retured
the result too.

public boolean tune() {
		//isTuned = !isTuned; 
boolean bTuned=true;

if(isTuned){

//will do this …
ceyezumma -3 Light Poster

I Just learned how to work with swing that way. I never use the GUI builder for any thing
but the basic component placement. I would never use it for anything else. I have an app with one master
panel for instance. It has components dropped on it. Then I have five classes
extending it all written by hand and each one of thoughs classes have at least
35 forms extending each one. On top of that I have more than 6 sets of the above
mentioned. I was just saying that I drag and drop one GUI and code the the rest.
so I created 5 pictures basically and coded at least 400 classes by hand.
I have taught myself a lot this way. I would like to share some code that is the root of
a form that when tables are added to a database the app will create a form
with just that meta data. This may be more advanced than the original question
posted by rotten69 but it could help someone with some automatic form creation written by hand.
I have added one form with one of the util classes used. Coding the GUI is almost
trival when compared to the other 400 classes. The technique works great. I could not add everything because the app has a database and 800 classes with properties and xml. But it all started by dragging and droppin …

ceyezumma -3 Light Poster

I have to agree to some degree. relying on generated code has no learning value at all. However, putting components on panel then that on a panel and on and on could take several hours to make a simple Panel of components.
Why not slap a dozen componets perfectly on a template in 4 minutes and then dig
in like you mentioned and learn how to use them. Swing is no trivial topic. That
is what aggravates me the most about my past College instructors whom assign Complicated logic programs like Calculating pi to 27 decimal places or figuring out
The square roots of all the prime numbers or dealing a deck of cards. Swing alone
Has a billion other concepts to learn before complicated logic or time consuming
Procedures. Creating a simple Container could be extremely time consuming. Everyone should definitely build a few by hand to learn the concept of putting panels on panels.
Personally, I taught myself by loading dozens of components To a container in 5 min. and the rest has to be done by hand : adding, propertyChaneEvents, fireEvents, add popups, menus, The list goes on and on of what is needed to learn.

ceyezumma -3 Light Poster

Hello.
Is there someone with experience using One Jar or any other technique to
create an exe. file from a Netbeans project with a lib full of .jar dependencies.

I am useing the One Jar technique and I am not having an success creating the
manifest.

Thanks
Steve

ceyezumma -3 Light Poster

Nope: no exceptions but thanks I happened to find a mis-spelled key in the xml.
it was hard to find. It works now .

ceyezumma -3 Light Poster

Oh ok. I missed those and you missed apache 's Mail api James
thanks

Ezzaral commented: Oh, was he supposed to list every mail api available for you? -3
ceyezumma -3 Light Poster

Soon I will be needing to generate reports and have a way to send emails.
Is there a good approach to accomplishing this? I will have data coming from Apache Derby Database and forms. If I could get some key words etc I could start to study
Possibilities.

Any links would be great. thanks

ceyezumma -3 Light Poster

cool code thanks

ceyezumma -3 Light Poster

Hello:

TABLE NAMES : /////////////////////////////////////////: :

TABLE NAMES : 10.6.2.1 - (999685): :

TABLE NAMES : Apache Derby: :

TABLE NAMES : Apache Derby Embedded JDBC Driver: :

TABLE NAMES : 10.6.2.1 - (999685): :

TABLE NAMES : /////////////////////////////////////////: :


Hello I have a problem understanding why my Prepared Statement is failing when I try to insert data into the
payee_available table. It just will not put data in the table.


I have inserted the exact same data (data types happened to match) into a similar table
Using code exactly as shown below for the payee_available table but I connected to
The instructor_available table instead. It all worked perfect. But I change the connection back to the
payee_available table and it will not insert the same data.

Is there an obvious mistake I am missing?

There is no error there is just not a response concerning the ps.executeUpdate();
it finds the prepared statement in the xml and prints it out as shown below then it just will not insert the records.

other prepared statements run good payee_available is the only problem.


The program is designed to insert an unlimited number of records. After it inserts the data shown below it
will return and build the next set and keep going intill it is done. All The other prepared statements do this but …

ceyezumma -3 Light Poster

I mentioned I could provide code I'm not sure what code to show at the moment.However, the link you provided is almost exactly what I am using. Thanks
for the link and I will try to find how to implement an interface with this.

ceyezumma -3 Light Poster

I can provide specifics concerning the app If there is anyone that know how to use a DAO.

ceyezumma -3 Light Poster

Hello.
I hava DAO classes to access tables of a Derby db. My DAO's all implement there own interface. I knew I would need to learn what this was. Is anyone farmiliar with
how an application would use an interface for the DAO classes ? I use xml properties to
connect to derby and I think (a year ago) I intended to use the power of the interface
to work with my DAOFactory.java that announces the data base to be used. I was wondering
if someone had experience writing an app that could use the DAOFactory class to switch
the database and properties sheet to switch form An embedded Derby database to a MySQl type
of database. What would this Interface I mentioned do to work with there DAO object?

ceyezumma -3 Light Poster

Hello all.


The Java Date and time classes are difficult.


I think I have to use java.sql.Date which is a sub
class of Date but is not a date unless the time is normalized to zero.
so I've heard.

I would like to work with my studentDOB first by collecting
a JFormatted field/put it in the bean /get the value from the bean/
put it back into the JFormatted textField.

I have DAO classes to collect and put results back to a form

Could someone help me get started with an example?

I use a JFormattedTextField that collect a obj as 12/31/2011. I don't
need mm,ss ect unless it is easier to start with

To collect the data to set the studentDOB I use

if (i == 7) {
  studentBean.setDob((Date) (txtFieldArray[i].getValue()));//format wanted 12/31/2011

}

I setString using

Just testing it using the :

----> ps.setDate(7, (java.sql.Date) studentUser.getDob());<----working with this one for now
@Override
    public boolean insertStudent() throws FileNotFoundException, IOException, SQLException {

  
                
        boolean insert = true;
        studentUser = MasterRegisterForm.studentBean;
        setTableName(tableName);
        try {
          
            conn = connect();          
    

                    
            ps = (PreparedStatement) conn.prepareStatement(
                    ModelUtils.getXMLResource("insertStudent"));

            ps.setString(1, studentUser.getNewUserUid());
            ps.setString(2, studentUser.getNewUserPassword());
            ...
                           
           ----> ps.setDate(7, (java.sql.Date) studentUser.getDob());<----working with this one for now

           ...
           
            ps.setString(14, studentUser.getEmail());

            int rowCount = ps.executeUpdate();
            if (rowCount != 1) {
                insert = false;
                close(conn, ps);  

                throw new RegisterException();
            } else {
                close(conn, ps);
                throw new SuccessfullRegistrationMessage();
            }

           
    
        } catch (InterruptedException ex) {
            Logger.getLogger(StudentSupplementalDAO.class.getName()).log(Level.SEVERE, null, ex); …
ceyezumma -3 Light Poster

My ie connection and program are in two seperate places for a minute.

I have the contens though:

Main-Class: Main

I am using netbeans to create the program and it has MANIFEST.MF and I do not know if I have to take all my stuff out and use myManifest.MF to get it to work.

any way the myManifest.txt is in the same folder that the Main.class is in with the above contents and i get the errror mentioned that states that it can not load an attribute.
Thanks for the help.

ceyezumma -3 Light Poster

That is a dialog box
but the dos messages is the same:

C:\Program Files\Java\jdk1.6.0_11\bin>java -jar C:\Users\depot\.gmFolders\gm.jar Failed to load Main-Class manifest attribute fromC:\Users\depot\.gmFolders\gm.jar C:\Program Files\Java\jdk1.6.0_11\bin>C:\Program Files\Java\jdk1.6.0_11\bin>java -jar C:\Users\depot\.gmFolders\gm.jar

Failed to load Main-Class manifest attribute from
C:\Users\depot\.gmFolders\gm.jar

C:\Program Files\Java\jdk1.6.0_11\bin>
ceyezumma -3 Light Poster

I still don't have the contents of the guitar_master.jar I still need to change the .zip extention and extract it.

Failed to load Main-Class.mnifest attribute fromC:\Users\depot\.gmFolders\gm.jarFailed to load Main-Class.mnifest attribute from
C:\Users\depot\.gmFolders\gm.jar
ceyezumma -3 Light Poster

I will have to do that and do some additional .jar command research
newbie question:
I have not compliled a program in so long( using netbeans)
if I have all the class files in with my manifest and all the main starts the chain
of imports for the whole program (anywhere from 40 60 131 classes)
then It will compile? I let netbeans handle all that so I am not sure if I will
have to extract all my classes and because I do not know how to run the thing.

ceyezumma -3 Light Poster

############################# results #####################################33

C:\Program Files\Java\jdk1.6.0_11\bin>jar -cvmf C:\Users\depot\Documents\ceyesum
ma\java_cache\my_projects\guitar_master_project\target_guitar_master\guitar_mast
er\guitar_master\build\classes\view\myManifest.txt C:\Users\depot\.gmFolders\gm.
jar C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\guitar_master_proj
ect\target_guitar_master\guitar_master\guitar_master\build\classes\view\Main.cla
ss
added manifest
adding: C:/Users/depot/Documents/ceyesumma/java_cache/my_projects/guitar_master_
project/target_guitar_master/guitar_master/guitar_master/build/classes/view/Main
.class(in = 944) (out= 584)(deflated 38%)

C:\Program Files\Java\jdk1.6.0_11\bin>
C:\Program Files\Java\jdk1.6.0_11\bin>jar tvf C:\Users\depot\.gmFolders\gm.jar
     0 Fri Aug 13 22:41:10 CDT 2010 META-INF/
    71 Fri Aug 13 22:41:10 CDT 2010 META-INF/MANIFEST.MF
   944 Tue Aug 10 21:19:08 CDT 2010 C:/Users/depot/Documents/ceyesumma/java_cach
e/my_projects/guitar_master_project/target_guitar_master/guitar_master/guitar_ma
ster/build/classes/view/Main.class


C:\Program Files\Java\jdk1.6.0_11\bin>

I still have to change he extention and try to unzip it.

This does something but I do not know where to find what ever it did
it was supposed to unpack something and put the files in the current dir

C:\Program Files\Java\jdk1.6.0_11\bin>jar -xf C:\Users\depot\.gmFolders\gm.jar

C:\Program Files\Java\jdk1.6.0_11\bin>

running is missing the attribute im myManifet
myManifest.txt

Main-Class: Main

running is missing the attribute im myManifet

C:\Program Files\Java\jdk1.6.0_11\bin>java -jar C:\Users\depot\.gmFolders\gm.jar

Failed to load Main-Class manifest attribute from
C:\Users\depot\.gmFolders\gm.jar

C:\Program Files\Java\jdk1.6.0_11\bin>

The file says it is .exe but it still isn't. Do I have to mess with a class path?
will have to take it out of Netbeans to run it with my own manifest?

ceyezumma -3 Light Poster

Hllo;
How does a JInternalFrame in a JDesktop know when is the focus owner if it is not
selected by the user?
thanks

ceyezumma -3 Light Poster

Thanks Mike I have no ie connection for a while. I will try this when I can get to my computer. I will get back to you.

incedentally the reacurring error is posted already and as far as I know the myManifest.txt (why that is not myManifest.MF I'm not sure) is in the build \clssses\view package of the project along side of the Main.class
NetBeans packages it something like that but the class file is in whith the mainfest
at the URL noted.

Is researching Java Installation tutorial a good choice to under stand this?
thanks again.

ceyezumma -3 Light Poster

Hello could any of this code bring the JinternalFrame with 11 tabs back into the scope of the menu items actionPerforme()?

.setSelected(true)  setSelectedFrame(JInternalFrame f)

thanks. I am not at my computer to try it but any additional key words to google would be great

ceyezumma -3 Light Poster

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 8, Tab count: 2
tlaa get vu.getResource: tabCount: 11
at javax.swing.JTabbedPane.checkIndex(JTabbedPane.java:1736)
at javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:572)
at view.menus.innerframe.admin.JMenuControlAdmin.controlJMenuItems(JMenuControlAdmin.java:53)

That says it all. Read the error messages that you get. Don't just throw them to other people.
At that line you are trying to set a too large index. It is like having an array of length 10 and are doing array[12]

Thanks, yes I noticed that and that is why I wanted to know how to get the JIntternalframe
with 11 tabs back in scope of it menu because the menu is using the last JInternalframe it created to run an operation.

the menu creates a new internal frame with 4 or so tabs but I need to learn how to grab focus on the origanal tab.

ceyezumma -3 Light Poster

Hello Mike:
I am not sure on the whole proccess yet but here is what I have so far:


I have another program 'Guitar Master'.I need to create this .jar gm.jar. and make it
executable.
then put this gm.jar inside the package of of 'Guitar Master' program. I have to be able to run the program when the client puts the disk in thier computer (not sure yet) I am having trouble understanding how to run any program outside of netbeans.

but if the program runs its first job is to take the gm.jar and put it on the clients
C:\ in the folder the program already creates. Also, it should create or put an icon on the
desktop so as to run the gm.jar .exe (pending).

The 'Guitar Master' program itself runs good. In need to install it.

using the command line-not java
the command below deminstates that using the command line does almost the same
thing. It just creates a .jar of something ?? found in the program package and
creates and puts a gm.jar on the C:\ in the gmFolders dir as planned.

this is the command and resultS:

C:\Program Files\Java\jdk1.6.0_11\bin>jar -cvmf C:\Users\depot\Documents\ceyesum
ma\java_cache\my_projects\guitar_master_project\target_guitar_master\guitar_mast
er\guitar_master\build\classes\view\myManifest.txt C:\Users\depot\.gmFolders\gm.
jar C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\guitar_master_proj
ect\target_guitar_master\guitar_master\guitar_master\build\classes\view\Main.cla
ss
added manifest
adding: C:/Users/depot/Documents/ceyesumma/java_cache/my_projects/guitar_master_
project/target_guitar_master/guitar_master/guitar_master/build/classes/view/Main
.class(in = 944) (out= 584)(deflated 38%)

C:\Program Files\Java\jdk1.6.0_11\bin>jar -cvmf C:\Users\depot\Documents\ceyesum
ma\java_cache\my_projects\guitar_master_project\target_guitar_master\guitar_mast
er\guitar_master\build\classes\view\myManifest.txt C:\Users\depot\.gmFolders\gm.
jar C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\guitar_master_proj
ect\target_guitar_master\guitar_master\guitar_master\build\classes\view\Main.cla
ss
[b]added manifest[/b]
adding: C:/Users/depot/Documents/ceyesumma/java_cache/my_projects/guitar_master_
project/target_guitar_master/guitar_master/guitar_master/build/classes/view/Main
.class(in = 944) (out= …
ceyezumma -3 Light Poster

I am unclear to say the least on writing my whole project from a disk to a hard drive
an install if you will. I am trying to write the program to do these things.
someone get the disk
the program runs
the program needs to copy an executable .jar file to a folder my program already creates then I would like to learn how to additionally create a icon on the desktop so the program can run.

I understanding of this is confused. Is any of this possible? Like I said before
I can create the .jar and I am having trouble getting the manifest.mf correct at the moment but In my linited understanding I would like to be able to have my program move a executable .jar to the clients hard drive.

can you comment on how I would go about adding a icon to a desktop that could run the program?
thanks
any info is good I need to researh all of the concepts.

ceyezumma -3 Light Poster

Thanks I will try that. I just read this: is this a different subject?

Creating a Manifest for a JAR File 
A manifest for a JAR file can only be created from an input stream. This example creates a manifest from a file and from a constructed string. The format of a manifest is described in: 
COPY
http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html
COPY
try {
    // Create a manifest from a file
    InputStream fis = new FileInputStream("manifestfile");
    Manifest manifest = new Manifest(fis);


    // Construct a string version of a manifest
    StringBuffer sbuf = new StringBuffer();
    sbuf.append("Manifest-Version: 1.0\n");
    sbuf.append("\n");
    sbuf.append("Name: javax/swing/JScrollPane.class\n");
    sbuf.append("Java-Bean: True\n");

    // Convert the string to a input stream
    InputStream is = new ByteArrayInputStream(sbuf.toString().getBytes("UTF-8"));

    // Create the manifest
    manifest = new Manifest(is);
} catch (IOException e) {
}
Here's an example of a manifest file: 
COPY
Manifest-Version: 1.0
Specification-Title: Java Platform API Specification
Specification-Version: 1.4
Implementation-Title: Java Runtime Environment
Implementation-Version: 1.4.0-rc
Created-By: 1.4.0-rc (Sun Microsystems Inc.)
Implementation-Vendor: Sun Microsystems, Inc.
Specification-Vendor: Sun Microsystems, Inc.

Name: javax/swing/JScrollPane.class
Java-Bean: True

Name: javax/swing/JCheckBoxMenuItem.class
Java-Bean: True

Name: javax/swing/JTabbedPane.class
Java-Bean: True

Name: javax/swing/JMenuItem.class
Java-Bean: True

Name: javax/swing/JTable.class
Java-Bean: True
ceyezumma -3 Light Poster

////////////////////////////////////////////////
moving a .jar to sys dir
//////////////////////////////////////////
Hello;
I can make a .jar from my program and move it to a folder in my progject
The Command to make the -cmf (non runnable) .jar
works fine by adding the .jar to a folder in my project.
but my question is:
what do I have to do to create that .jar if it originated on
a disk drive and write it to a dir I have created on the hard drive?


thanks

ceyezumma -3 Light Poster

/////////////////////////////////////////////
make .jar runnable
//////////////////////////////////////////
Hello;
I can make a .jar from my program and move it to a folder in my progject but I would like to make
it runnable. So I have shown the Command to make the -cmf (non runnable) .jar that
works fine.
I will show the myManifest for the -cvmf (runnable) command but it will not load
the attribute from schoolofdb.jar.

I thought the attribute would be found in the myManifest.mf shown below.
the schoolofdb.jar is created as before but not runnabale. please find the error
stated below.

thanks
working -cmf command works fine

C:\Program Files\Java\jdk1.6.0_11\bin>jar -cvmf C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\schooldb_project\target_schooldb\schooldb\schoolofdb\myManifest.mf C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\schooldb_project\target_schooldb\schooldb\schoolofdb\test\schoolofdb.jar C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\schooldb_project\target_schooldb\schooldb\schoolofdb

-cmvf command will not load

jar -cvmf C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\schooldb_project\target_schooldb\schooldb\schoolofdb\myManifest.mf C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\schooldb_project\target_schooldb\schooldb\schoolofdb\test\schoolofdb.jar C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\schooldb_project\target_schooldb\schooldb\schoolofdb

above 3 params

jar -cvmf C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\schooldb_project\target_schooldb\schooldb\schoolofdb\myManifest.mf 

C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\schooldb_project\target_schooldb\schooldb\schoolofdb\test\schoolofdb.jar

 C:\Users\depot\Documents\ceyesumma\java_cache\my_projects\schooldb_project\target_schooldb\schooldb\schoolofdb

b]myManifest.mf this is the only thing in the myManifest[/b]

main.class=view.main

b]error when trying to click the schoolofdb.jar created using -cvmf [/b]

Failed to load Main-Class mnifest attribute from
C:\Users\depot\Documents\ceyesumma\java-cach\my_projects\schoolofdb_project\targetPcchoolofdb\schooldb\schoolofdb\test\schoolofdb.jar
ceyezumma -3 Light Poster

j
/////////////////////////////////////////
Hello;
I Have a JDesktopPane that opens with a x frame (JInternalFrame)wit
a JMenuBar and 11 JTabbedPanels .produced by x.class.I click the menuItem to produce z.frame using x.class
a new JInternalFrame with 4 tabbedPanels on it again produced by x.class.
Now I click on x.frame and try to again use the menuBar and
x.frame is out of scope the menuItem clicked tries to perform its actionPerformed
using the InternalFrame with 4 tabs instead of the intended 11 tabbed JInternalFrame.

Is there a standard for requesting scope or fireing InternalFrame events or validation of which frame is
enabled?
Thanks
error

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 8, Tab count: 2
tlaa get vu.getResource: tabCount: 11
        at javax.swing.JTabbedPane.checkIndex(JTabbedPane.java:1736)
        at javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:572)
        at view.menus.innerframe.admin.JMenuControlAdmin.controlJMenuItems(JMenuControlAdmin.java:53)
        at view.menus.innerframe.admin.CreateInnerFrameMenuAdmin$16.actionPerformed(CreateInnerFrameMenuAdmin.java:449)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
        at java.awt.Component.processMouseEvent(Component.java:6134)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265
ceyezumma -3 Light Poster

Topic
The topic of this question is: db_connect+my stmt
Hello and Thank you in advance for any assistance.


System info:

Noted in previous post.


The purpose of this post is:

Display supplied stmt from above mentioned tutorial. Stmt throws an error as noted in previous post.

Display my new stmt.



Code description:supplied stmt

"SELECT u.uid, firstName, lastName, address1, address2, city, postCode, email, phone, ug.groupName as userGroup "
+"FROM user u, usergroup ug WHERE uid='"+userName+"' AND password='"+password+"' AND groupName IN"
+" (SELECT groupName FROM usergroup WHERE groupid =(SELECT groupid FROM usergroup_mapping WHERE uid=u.uid)


Code description: my new statement

String strQuery = "SELECT u.uid, u.password,ug.groupName FROM user AS u,usergroup AS ug,usergroup_mapping AS ugm WHERE u.uid='userName' AND u.password='password' AND u.uid=ugm.uid AND ugm.groupid=ug.groupid";


My question concerning this code is:

If my new stmt produces the required field when I run it on the databases. Why doesn’t the login except username=10101010 password =StealthProject which is in the data base?


The errors related to this code are:
my new stmt:

Initializing Sun's JavaServer Faces implementation (1.2_04-b22-p05) for context '/school'
Initialize <------------>jdbcDriver<------------>
10101010<------------>StealthProject
Error on DB return
java.lang.NullPointerException
        at servlets.LoginServlet.doPost(LoginServlet.java:82)


Thanks again.
-ceyesuma