Solved

Connectivity of Java with Excel using JDBC ODBC

Posted on 2007-11-18
5
1,049 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

911 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

15 Experts available now in Live!

Get 1:1 Help Now