954,554 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

JDBC for Access Database

Hi,
I have connected to a MS Access database but when I try to insert data through the java interface, it gives an error which is

[MICROSOFT][ODBC MICROSOFT ACCESS DRIVER] TOO FEW PARAMETERS.EXPECTED 2.

I dont know y its giving me this error. All the parameters r correct. Can any 1 help me. Im developing a container tracking system for a company. I have worked with Java and Oracle. This is my first time with Java and MS Access.

hkhan45
Newbie Poster
Banned
7 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

I've seen that before when using MS-Access. If one of your field names is unknown, then MS-Access considers that field a parameter and generates this sort of error. It can also be another identifier, other than a field name, something that MS-Access cannot lookup.

Make your query as simple as you can, just select * from table and then add more in until you start getting the error. Or perhaps print out your query/insert and try it directly in MS-Access itself.

JeffHeaton
Junior Poster in Training
58 posts since Jul 2005
Reputation Points: 12
Solved Threads: 0
 

" dont know y its giving me this error. All the parameters r correct. Can any 1 help me. Im developing a container tracking system for a company. I have worked with Java and Oracle. This is my first time with Java and MS Access."

You saved yourself 7 characters by writing that nonsense "y, r, 1". Was that really worth it?
If you consider yourself a professional (which you seem to do), don't use such shorthand language.

And oh, for a production application NEVER use the JDBC-ODBC bridge driver from the JDK. It's for demonstration and testing only, too unstable and poorly performant for realworld use.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Respected Sir, Thank u 4 ur kind help and ur reply is highly appreciated. I kind of solved the problem my self yesterday. I did not close the single quote :o . Thanks anyways. Is there some other method for connecting Java to Access so that it can give meaning full and specific error messeges ?

hkhan45
Newbie Poster
Banned
7 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

If u could read carefully ( instead of searching for short hand writting ) I never said nor proved nor implied that I am a professional. I am an Internee and we tend to gain experience not to Show Off ( which u seem to be doing ). Please consider the following link.
www.orkut.com

P.S U still did'nt give me ur "Professional" Answer for the Problem.

hkhan45
Newbie Poster
Banned
7 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

I consider correct use of language to be extremely important for people creating software.
After all, software is a description of what a computer is to do written in a language.
If you can't even be bothered to use natural language correctly to communicate your thoughts, you probably don't bother to do the same to that computer.
And if you're incapable of communicating in natural language, you're also incapable of learning the skills needed to communicate with that computer effectively as those skills are passed along in that natural language.

Given that there is a highly disturbing trend of people incapable or unwilling to communicate in natural language using that language correctly and that trend coincides with a similar trend of those same people failing to write software that works, there does seem to be a strong link between the two phenomenon.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

If u ever learned a programming language ( which I doubt ) there is a big difference between a Programming Language Syntax and Natural Language. There R NO SHORT HAND WRITTING embeded in a programming language or designed like r,u,y etc for writting software code or Instructing a computer to do a certain task. But Still What ever makes u happy. Keep ur "PHENOMENA" with u. There is a rule of thumb for using any Natural language and that is MANNERS which u lack big time.

hkhan45
Newbie Poster
Banned
7 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

I've read this and consider that jwenting has actually made effort to be polite in communicating what might be a tad off topic but nevertheless a very valid point. In any professional circle (and by professional I mean workplace, not simply trained and qualified people) the use of SMS or IM style abbreviated language is very much frowned upon.

It portrays a quite negative impression of you, and jwenting is only seeking to help you avoid that happening.

Catweazle
Grandad
Team Colleague
4,335 posts since Mar 2004
Reputation Points: 229
Solved Threads: 149
 

I don't know what this whole thread is about, and I prefer to stay out of it, because I don't do well with insults and flame wars, but I just wanted to add that when programming, there are often an infinite number of ways to do a particular thing. Not only are there an infinite number of algorithms to do a task, but there are an infinite number of ways to execute (code) an algorithm. Not only that, but syntax / shorthand does exist for programming code. For example, in the C++ language,

x = x + 1;


can also be represented as

x += 1;


in addition to as

x++;


Just a shorthand way of writing it :)

cscgal
The Queen of DaniWeb
Administrator
19,427 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

Yes, but it's shorthand that's part of the language specification.
It's like writing e.g. instead of "for example".
If I were to write "fe" when I mean "for example" noone'd understand me, right?
Same if I were to write x+; when I want to write x=x+1; the compiler will complain :)

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

I've read this and consider that jwenting has actually made effort to be polite in communicating what might be a tad off topic but nevertheless a very valid point. In any professional circle (and by professional I mean workplace, not simply trained and qualified people) the use of SMS or IM style abbreviated language is very much frowned upon.

It portrays a quite negative impression of you, and jwenting is only seeking to help you avoid that happening.

If u call that Polite, THEN May God Help U. Ur reply also portrays a quite negative impression of u. This is a forum to solve programming problems not communication skills.

hkhan45
Newbie Poster
Banned
7 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

By short hand I didn't mean adding or subtracting. This is my point. U dont use Natural Language in programming languages. They already have a syntax designed for them. U use the syntax to convey ur message to computers and people using ur software or maintaining the software not natural language.
For example u wont say to a computer to "Please print"
U will say : System.out.println("Please Print");

As u can notice no Short Hand like sys for System or pln for print line !!!

hkhan45
Newbie Poster
Banned
7 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

hkhan45, I popped into this topic an an effort to nicely try to defuse what seemed possible to turn into flaming. Yes I do think the initial request was an effort to point things out in a friendly manner. I now think that belligerence is being displayed.

It is extremely common on most tech sites that I've encountered for people to be asked to make the effort to type their posts in the best grammar/spelling they are able, and to avoid such things as '133t speak' and IM abbreviations. It is not considered 'impolite' to make such a request.

If I was confronted with a question looking like that inthe Tech section, for example, I'd quite probably respond with:

"Do you mind trying to type that out in English? Trying to read it makes my eyes bleed!"

Now could we leave this sidetrack go please? These comments have not been personally directed. They are simply an accurate depiction of how things work on tech message boards. You can choose to continue posting as you are of course, and it's quite probable that people will be reluctant to offer advice as a result. It's probably also inevitable that others will also ask that you use english rather than some 'home brew' of abbreviations.

Catweazle
Grandad
Team Colleague
4,335 posts since Mar 2004
Reputation Points: 229
Solved Threads: 149
 

hkhan45, I popped into this topic an an effort to nicely try to defuse what seemed possible to turn into flaming. Yes I do think the initial request was an effort to point things out in a friendly manner. I now think that belligerence is being displayed.

It is extremely common on most tech sites that I've encountered for people to be asked to make the effort to type their posts in the best grammar/spelling they are able, and to avoid such things as '133t speak' and IM abbreviations. It is not considered 'impolite' to make such a request.

If I was confronted with a question looking like that inthe Tech section, for example, I'd quite probably respond with:

"Do you mind trying to type that out in English? Trying to read it makes my eyes bleed!"

Now could we leave this sidetrack go please? These comments have not been personally directed. They are simply an accurate depiction of how things work on tech message boards. You can choose to continue posting as you are of course, and it's quite probable that people will be reluctant to offer advice as a result. It's probably also inevitable that others will also ask that you use english rather than some 'home brew' of abbreviations.

Please dont try to difuse any thing. Ur not good at that.
"You can choose to continue posting as you are of course,"
Like ur not posting any thing right !! . Ur talking like ur the only 1 left for advise. There r hudreds of thousands of programmers around the world.people can go any where and ask any 1 any time. If u think ur the only 1, WAKE UP the world is full of them and thanks for not helping.

hkhan45
Newbie Poster
Banned
7 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

I've tried being nice. I've tried being quite clear almost to the point of bluntness. It's not going to make any difference, is it?

Please go to one of those hundreds of thousands of places 'U' seem to know of ;)


Topic closed.

Catweazle
Grandad
Team Colleague
4,335 posts since Mar 2004
Reputation Points: 229
Solved Threads: 149
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You