I'm trying to get a little head start on the upcoming class and I
noticed that in Lab-4016 you show:'

public BookDBAO() throws Exception {
        try {
            Context initCtx = new InitialContext();
            Context envCtx = (Context) initCtx.lookup("java:comp/
env");
            DataSource ds = (DataSource) envCtx.lookup("jdbc/BookDB");
            con = ds.getConnection();

... but the actual file has most of that code commented out and
replaced with ...

public BookDBAO() throws Exception {
        try {

            Context initCtx = new InitialContext();
            Context envCtx = (Context) initCtx.lookup("java:comp/
env");
            /*System.out.println("initCtx is " + (initCtx==null ?
"null." : "created."));
            System.out.println("envCtx is " + (envCtx==null ?
"null." : "created"));
            DataSource ds = (DataSource) envCtx.lookup("jdbc/BookDB");
            System.out.println("ds is " + (ds==null ? "null." :
"created."));
            con = ds.getConnection();
            System.out.println("con is " + con ==null ? "null." :
"created.");
            */
            Class.forName(dbdriver);
            con = DriverManager.getConnection(url, username,
password);

When I remove the comments and instead comment out the last 2 lines, I
get the message:

"messageServlet BookStoreServlet is not available"

Not sure what's going on here. Any clues?

Thx, Dennis

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to