lspci -v)00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)and Ubuntu 7.10 Gutsy. Here are my settings from gnome-volume-manager (screenshots) that works with skype.

lspci -v)00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)and Ubuntu 7.10 Gutsy. Here are my settings from gnome-volume-manager (screenshots) that works with skype.

Next post about very obvious thing, but I've lost about 30 minutes to find out how to do it. So this post is some kind of note, for my information.
The problem was, how to get yesterday date from datefield. I use very nice component DataPicker from Microba Controls library which deliver calendar. Ok but back to topic. How to get a day before some date selected on that component, or day after, or back to today's date. Example:
// -1 day
try {
Calendar c = Calendar.getInstance();
c.setTime(dateField.getDate()); // set calendar date from field
c.add(Calendar.DATE, -1); // substract one day
dateField.setDate(c.getTime());
} catch (PropertyVetoException ex) {
ex.printStackTrace();
}
// today
dateField.setDate(new Date());
// + 1 day
try {
Calendar c = Calendar.getInstance();
c.setTime(dateField.getDate()); // set calendar date from field
c.add(Calendar.DATE, 1); // add one day
dateField.setDate(c.getTime());
} catch (PropertyVetoException ex) {
ex.printStackTrace();
}
I'm still writing this stupid frontend for database. Really it's confusing when have to write piece of software only for student project. Never mind. I've left idea with web app written in jsp/jsf (god's know what else) and 've started a new project. It's also would be tv schedule, but now it would be a desktop app written using netbeans, swing, postgresql and jpa.
So, todays problem. How to insert new object into database? I've written the front controller for a model, with method addStacja that get a Stacjtv object as an argument.
public boolean addStacjatv(Stacjatv st) {
em = getEntityManager();
try {
em.getTransaction().begin();
em = getEntityManager();
try {
em.getTransaction().begin();
em.persist(st);
em.getTransaction().commit();
return true;
} finally {
em.close();
} em.persist(st);
em.getTransaction().commit();
return true;
} finally {
em.close();
}
}
simple code, nothing special. But every time, when I invoke it, I get exception:
Internal Exception: org.postgresql.util.PSQLException: ERROR: null value in column "id" violates not-null constraint
Error Code: 0
Call: INSERT INTO stacjatv (id, url, opis, nazwa) VALUES (?, ?, ?, ?)
bind => [null, fff, fff, ff]
...
@Id
// start modyfication
@GeneratedValue(generator="stacjatv_id_seq",strategy=GenerationType.SEQUENCE)
// end
@Column(name = "id", nullable = false)
private Integer id;
...
I've started learning JSP, JSF and other stuff used to develop J2EE apps. Of course everything is standing on database, and with accessing to the postgresql database I had the biggest problem.
I start with tutorials founded on netbeans.com web site, 1st Using Java Persistence API Within a Visual Web Application, but unfortunately every time when I start application I got such error on glassfish console:
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: No suitable driver found for jdbc:postgresql://ldap.krajniak.test/lastvideo
Error Code: 0
(...)
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:postgresql://ldap.krajniak.test/lastvideo
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:100)
... 97 more
sending notification to server...server