• Post Reply Bookmark Topic Watch Topic
  • New Topic

Odd LookAndFeel / JDBC problem

 
John Edward
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I was torn between posting this here or to the JDBC forum, but I'll start here.
I'm developing an application using JDBC and everything seems fine as long as I am using the Metal or Motif L&F's. (I was also able to use the Kunststoff L&F).
The problem occurs when I try to use either the Windows L&F (com.sun.java.swing.plaf.windows.WindowsLookAndFeel) or one of the themepacks using SkinLF (com.l2fprod.gui.plaf.skin.SkinLookAndFeel)
When I am using one of those, the application starts up - opens a JDBC connection, and then immediately closes the connection.
This results in a NullPointerException as soon as any of the other code tries to use the connection.
Has anyone seen anything like this before? I would have thought that the L&F would have no impact on a DB connection but it is the only line of code that I need to change to produce the error.
Thanks in advance for any insight into this odd problem,
--John

P.S. The stack trace is here if anyone finds it useful:
java.sql.SQLException: java.lang.NullPointerException
at com.inet.tds.TdsDriver.createSQLException(TdsDriver.java)
at com.inet.tds.TdsConnection.ausgabe(TdsConnection.java)
at com.inet.tds.TdsStatement.exImpl(TdsStatement.java)
at com.inet.tds.TdsStatement.executeQueryImpl(TdsStatement.java)
at com.inet.tds.TdsStatement.executeQuery(TdsStatement.java)
at com.unittester.database.TestDAO.findAllTests(TestDAO.java:168)
at com.unittester.ui.TestConfigPanel.loadTestTable(TestConfigPanel.java:
237)
at com.unittester.ui.TestConfigPanel.buildGUI(TestConfigPanel.java:200)
at com.unittester.ui.TestConfigPanel.<init>(TestConfigPanel.java:76)
at UITestDrive.go(UITestDrive.java:75)
at UITestDrive.main(UITestDrive.java:46)
Exception in thread "main" java.lang.NullPointerException
at com.unittester.ui.table.TestTableModel.convertToDisplayVector(TestTab
leModel.java:73)
at com.unittester.ui.table.TestTableModel.<init>(TestTableModel.java:38)
at com.unittester.ui.TestConfigPanel.loadTestTable(TestConfigPanel.java:
239)
at com.unittester.ui.TestConfigPanel.buildGUI(TestConfigPanel.java:200)
at com.unittester.ui.TestConfigPanel.<init>(TestConfigPanel.java:76)
at UITestDrive.go(UITestDrive.java:75)
at UITestDrive.main(UITestDrive.java:46)
 
John Edward
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A little more information on this problem.
I am running Windows NT - SP6A and using JDK 1.4.1_02
I also tried it on my home computer running Windows XP and the same JDK version.
On this machine, it worked a couple of times and then started failing intermittently. If I keep launching the application over and over it will eventually succeed but it may take several tries before it works.
I'm now wondering if there is a timing problem and threads are sometimes getting blocked causing the DB connection to close? I'm not explicitly starting separate threads for the UI code yet, but I thought I read somewhere that Swing components will start their own threads. Could this be part of the problem?
Still hoping someone has a suggestion,
--John
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!