Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Unable to fill pool

843859Sep 13 2006 — edited Sep 14 2006
Please sugget a sloution for the following exception..

15:03:26,682 INFO [STDOUT] [[web]WebDisp Errors]Mon Sep 11 15:03:26 MDT 2006 Customer not found
15:03:33,249 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection:
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Connection is broken: Connection refused)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:153)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:372)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:185)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.java:333)
at org.jboss.resource.connectionmanager.PoolFiller$1.run(PoolFiller.java:63)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: Connection is broken: Connection refused
at org.hsqldb.Trace.getError(Unknown Source)
at org.hsqldb.Trace.error(Unknown Source)
at org.hsqldb.jdbcConnection.reconnectHSQL(Unknown Source)
at org.hsqldb.jdbcConnection.openHSQL(Unknown Source)
at org.hsqldb.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:143)
... 5 more
15:03:33,250 WARN [JBossManagedConnectionPool] Unable to fill pool
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Connection is broken: Connection refused)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:153)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:372)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:185)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.java:333)
at org.jboss.resource.connectionmanager.PoolFiller$1.run(PoolFiller.java:63)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: Connection is broken: Connection refused
at org.hsqldb.Trace.getError(Unknown Source)
at org.hsqldb.Trace.error(Unknown Source)
at org.hsqldb.jdbcConnection.reconnectHSQL(Unknown Source)
at org.hsqldb.jdbcConnection.openHSQL(Unknown Source)
at org.hsqldb.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:143)
... 5 more


Thanks,
Unmesh

Comments

camickr
You create a combo box and use the addItem() method to add Date or Calendar objects to the combo box.

What exactly is your problem?
843805
My problem. is how I create the Dates... from Jan-01-2007 to Mar-03-2007...

Wath I have to use... java.util.Date, java.sql.Date, Calendar or GregorianCalendar???

Thats my real problem...

Sorry if I not explain so good before...

Thanks for your time... and Regards...
794342
use GregorianCalendar and set it to the first date you want
another gc set to the end date
you want to show the date in a particular format, so you'd use SimpleDateFormat()

then it's just
while(gcStart.after(gcEnd) == false)//dates inclusive
{
  combo.addItem(sdf.format(gcStart.getTime()));
  gcStart.[add a day];
}
843805
Thanks for your mini example...

Anything, I post it...

Regards... and Thanks again...
843805
//here is an example how to get the date
//I think this might help you!!!

import java.text.DateFormat;
import java.util.Date;

public class DateFormatExample1 {

    public static void main(String[] args) {
        // Make a new Date object. It will be initialized to the current time.
        Date now = new Date();

        // See what toString() returns
        System.out.println(" 1. " + now.toString());

        // Next, try the default DateFormat
        System.out.println(" 2. " + DateFormat.getInstance().format(now));

        // And the default time and date-time DateFormats
        System.out.println(" 3. " + DateFormat.getTimeInstance().format(now));
        System.out.println(" 4. " + 
            DateFormat.getDateTimeInstance().format(now));

        // Next, try the short, medium and long variants of the 
        // default time format 
        System.out.println(" 5. " + 
            DateFormat.getTimeInstance(DateFormat.SHORT).format(now));
        System.out.println(" 6. " + 
            DateFormat.getTimeInstance(DateFormat.MEDIUM).format(now));
        System.out.println(" 7. " + 
            DateFormat.getTimeInstance(DateFormat.LONG).format(now));

        // For the default date-time format, the length of both the
        // date and time elements can be specified. Here are some examples:
        System.out.println(" 8. " + DateFormat.getDateTimeInstance(
            DateFormat.SHORT, DateFormat.SHORT).format(now));
        System.out.println(" 9. " + DateFormat.getDateTimeInstance(
            DateFormat.MEDIUM, DateFormat.SHORT).format(now));
        System.out.println("10. " + DateFormat.getDateTimeInstance(
            DateFormat.LONG, DateFormat.LONG).format(now));
    }
}
843805
Thanks to you too...

I really appreciate your time...
800351
Here's a quick trial of a custom component. You can add a variety of constructors.
import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.text.*;
import static java.util.Calendar.*;

public class DateComboBox extends JComboBox{
  static final Locale loc = Locale.US;

  SimpleDateFormat dateFmt;
  GregorianCalendar startDay;
  int daysSpan;
  Vector<GregorianCalendar> dvec;
  Vector<String> svec;

  public DateComboBox(GregorianCalendar start, int span, String fmtString){
    GregorianCalendar curDate;

    startDay = start;
    daysSpan = span; // days; not month, year, hour etc.
    dateFmt = new SimpleDateFormat(fmtString, loc);
    curDate = startDay;

    svec = new Vector<String>();
    dvec = new Vector<GregorianCalendar>();

    for (int i = 0; i < span; ++i){
      dvec.add(curDate);
      svec.add(dateFmt.format(curDate.getTime()));
      curDate.add(DAY_OF_MONTH, 1);
    }

    setModel(new DefaultComboBoxModel(svec));
  }

  public Vector<GregorianCalendar> getDateVector(){
    return dvec;
  }

  public GregorianCalendar[] getDateArray(){
    return (GregorianCalendar[])(dvec.toArray());
  }

  public static void main(String[] args){
    DateComboBox dcb = new DateComboBox(
        new GregorianCalendar(2007, 0, 1),
        61,
        "MMM-dd-yyyy");

    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    frame.getContentPane().add(dcb, BorderLayout.NORTH);
    frame.setSize(300, 300);
    frame.setVisible(true);
  }
}
843805
Thanks all of you...

I do it...

Regards...
1 - 8
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 12 2006
Added on Sep 13 2006
4 comments
4,877 views