[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Connectivity of Java with Excel using JDBC ODBC

Posted on 2007-11-18
5
Medium Priority
?
1,091 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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month18 days, 10 hours left to enroll

834 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