[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1093
  • Last Modified:

Connectivity of Java with Excel using JDBC ODBC

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
MeenakshiDhar
Asked:
MeenakshiDhar
  • 3
  • 2
1 Solution
 
MeenakshiDharAuthor Commented:

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
 
objectsCommented:
the driver does not support that operation
0
 
MeenakshiDharAuthor Commented:
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
 
objectsCommented:
its the M$ odbc drive that does not support it.
you would need to use an api (eg. jexcel) instead of jdbc
0
 
MeenakshiDharAuthor Commented:
Thanks a lot objects...
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now