question

nahidj avatar image
nahidj asked

I'm getting this error message when I'm trying to run my login form in netbeans. What could be the reason

I'm getting this error message when I'm trying to run my login form in netbeans. What could be the reason run: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sa'.java.sql.SQL Exception: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sa'. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at niitranchiproject.login1.jButton1ActionPerformed(login1.java:146) at niitranchiproject.login1.access$000(login1.java:8) at niitranchiproject.login1$1.actionPerformed(login1.java:57) 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.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6038) at javax.swing.JComponent.processMouseEvent(JComponent.java:3260) at java.awt.Component.processEvent(Component.java:5803) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
help
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
sqlaj 1 avatar image
sqlaj 1 answered
Either the password you provided is not valid or the user is disabled. I also have to ask, why are you using the sa account? Best practice is to disable that account. I would create a user for your needs granting the least permissions needed to complete your tasking.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sqlaj 1 avatar image sqlaj 1 commented ·
Creating a user can be done with this code. Windows Login: CREATE LOGIN [domain\user_name] FROM WINDOWS; GO SQL Login: CREATE LOGIN new_userName WITH PASSWORD = 'password'; GO You should review this page as well. http://msdn.microsoft.com/en-us/library/aa337562.aspx
2 Likes 2 ·
nahidj avatar image nahidj commented ·
Yes please guide me. And what are the deatails that are required
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.