File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JDBC DB2 Type 4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC DB2 Type 4 " Watch "JDBC DB2 Type 4 " New topic
Author

JDBC DB2 Type 4

Ratan Kumar
Ranch Hand

Joined: Jul 19, 2006
Posts: 67
Hi,

I want to know about JDBC DB2 Type 4 driver.

I am written a test JSP. Can you please tell me if it confirms to Type 4 specification?

<BODY>
<%try {
Class.forName("com.ibm.db2.jcc.DB2Driver");
String url= "jdbc:db2://MYDB.domain.com:446/MYDB";
%>

<% java.sql.Connection connection = java.sql.DriverManager.getConnection(url,"myuser","mypass");%>

<%
connection.close();
} catch (Exception e) {
%>
Error : <%=e%>
<%
}
%>
</BODY>


Can some one please help me make sure that this is Type 4? What are the requirements and conditions for Type 4?

Thanks
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
It looks fine to me.

Originally posted by Scott Selikoff:
With the risk of being flamed, I find Wikipedia has a decent discussion of the driver levels: http://en.wikipedia.org/wiki/JDBC_type_3_driver

I tend to not worry about the level unless there's a problem with a specific driver. All and all I think the only database it mattered was with oracle and the performance differences were almost non-existent.

[ March 22, 2007: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Ratan Kumar
Ranch Hand

Joined: Jul 19, 2006
Posts: 67
Hi,

Thanks for your response.

I googled for this.I believe the following lines confirm that I am using Type 4

Class.forName("com.ibm.db2.jcc.DB2Driver");
String url= "jdbc:db2://MYDB.domain.com:446/MYDB";

Thanks again
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC DB2 Type 4