Hi, Friends I am new to JDBC I know how to connect the java prog to access with the help of type 1 driver can any one help me how to connect M S excel file to java .. help me from basic i dont know how to connect i was trying from last 10 days....
Welcome to JavaRanch. Please look carefully at the official naming policy at Javaranch & reregister yourself with a proper first & last name, with a space between them. Initials may be used for a first name, but not a last name. Please adhere to official naming policy & help maintain the decorum of the forum. The naming policy can be found at http://www.javaranch.com/name.jsp
To access a database management system (DBMS) in Java, you need a JDBC (Java Database Connectivity) driver. You may write such drivers, which range from types 1 to 4, in pure Java or a combination of Java and Java Native Interface (JNI) methods. The industry trend is towards the more robust types 3 and 4 pure-Java drivers. Type 3 drivers shine when supporting Internet deployment in environments that connect to a variety of DBMS servers requiring numerous concurrently connected users where performance and scalability are major concerns. Therefore, to develop a high-performance, Internet-deployable application, you'll often find it useful to convert your existing type 1 or 2 drivers to type 3 drivers.
Read the whole "Create Your Own Type 3 JDBC Driver" series:
Part 1: Connect your Java applications to databases�the easy way Part 2: Compile, deploy, and access data using your custom-built JDBC driver Part 3: Enhance the custom JWDriver with advanced logging, connection pooling, and Predefined Data Sets
In this three-part series, we first introduce our own type 3 JDBC driver's architecture and design (Part 1), then show how to implement and deploy the driver (Part 2), and finish by explaining how you can add advanced features to the driver, like SQL logging or connection pooling (Part 3).
Note: Before you read this article, you may wish to read Nitin Nanda's "JDBC Drivers in the Wild" (JavaWorld, July 2000) to better understand JDBC drivers.
welcome to JavaRanch. What you posted seems copied from somewhere; you need to provide the source from where you got that, lest it look like plagiarism. (I also fail to see how it helps answer the original question, but that's besides the point.)
If you just want to import data from a database into excel you don't need JDBC to do that. A bit of SQL and Excel knowledge should take you through. Excel has an inbuilt query wizard which allows you to connect to a database and execute queries. I will start you off in the right direction:
Open an excel sheet Click on data->Import External Data->New database query This will open data source selector While on database tab select <New data source> and hit ok Now you can select whatever is applicable in your case and start writing queries.
Joined: Mar 22, 2005
If you just want to import data from a database into excel you don't need JDBC to do that.[/QB]
The original post explicitly states "can any one help me how to connect MS excel file to java", so using Excel manually doesn't solve the problem.
If this was my problem I'd use POI, not JDBC, though.