Solved

Connectivity of Java with Excel using JDBC ODBC

Posted on 2007-11-18
5
1,041 Views
Last Modified: 2008-02-01
Hi All

I am using JDBC ODBC driver for connecting Java with Excel.
I am able to run insert, update, delete commands but when I am trying to use ALTER Table command it will give me following error:

Error!java.sql.SQLException: [Microsoft][ODBC Excel Driver] Invalid Operation

Can anybody please help..

Thansk in advance
Meenakshi Dhar
0
Comment
Question by:MeenakshiDhar
  • 3
  • 2
5 Comments
 

Author Comment

by:MeenakshiDhar
ID: 20310597

private void alterTable()

	{

		Statement lStat=null;

		try

		{

			lStat=getConnection().createStatement();

			//lStat.executeUpdate("ALTER TABLE " +getTableName()+" ADD COLUMN DATA VARCHAR");

			lStat.executeUpdate("ALTER TABLE " +getTableName()+" DROP DATA_BASE");

			lStat.close();

		}

		catch(Exception e4)

		{

			System.out.println("Error!"+e4);

		}

	}

Open in new window

0
 
LVL 92

Expert Comment

by:objects
ID: 20310614
the driver does not support that operation
0
 

Author Comment

by:MeenakshiDhar
ID: 20310644
Is this for sure that JDBC ODBC driver does not support that operation..If yes, then  is there any alternative way to do this task..
0
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 20310821
its the M$ odbc drive that does not support it.
you would need to use an api (eg. jexcel) instead of jdbc
0
 

Author Comment

by:MeenakshiDhar
ID: 20311045
Thanks a lot objects...
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now