Solved

Connectivity of Java with Excel using JDBC ODBC

Posted on 2007-11-18
5
1,072 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

730 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