This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes MKoi database error - reads values when looking for column headings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MKoi database error - reads values when looking for column headings" Watch "MKoi database error - reads values when looking for column headings" New topic

MKoi database error - reads values when looking for column headings

Susie Biddulph

Joined: Jul 06, 2005
Posts: 2
Hi all,

I'm quite new to mcKoi and I'm trying to use it with JDBC.
I've had success with the SELECT statement, but when I try to INSERT a record I get a....

Here is my code snippet to show the query string I am submitting:-

and here is the debug message I get - note that the values are being interpreted as column names. If you have come across this before, I would be pleased if you could advise me on what I did wrong....

% Starting Database Server
**** Debug log started: Sun Jul 03 15:08:58 BST 2005 ****
% Storage System: v1 file storage mode.
% Internal Data Cache size: 4194304
% Internal Data Cache max cell size: 8192
% lookup_comparison_list = false
% read_only = false
% transaction_error_on_dirty_select = true
% ignore_case_for_identifiers = true
% Java NIO API is available.
% io_safety_level = 10
% Using stardard IO API for heap buffered file access.
% [Buffer Manager] Using IO API: Java IO
% [Buffer Manager] Page Size: 8192
% [Buffer Manager] Max pages: 256
% Using regex bridge: gnu.regexp
% No 'function_factories' config property found.
% statement_cache = true
% Max worker threads set to: 4
% Starting Database Server
> com.mckoi.database.V1FileStoreSystem ( lvl: 20 )
File lock file exists: .\data\DefaultDatabase.lock
> com.mckoi.database.jdbcserver.DefaultLocalBootable$LocalJDBCDatabaseInterface ( lvl: 20 )

Exception thrown during query processing on: [ Query:
[ INSERT INTO member_sb (first ,last ,age ,email) VALUES (Jerry,Smith,27,blah) ]
[ TIME: Sun Jul 03 15:08:59 BST 2005 ]
% com.mckoi.database.StatementException: Can't find column: Jerry

at com.mckoi.database.interpret.Statement.resolveColumn(
at com.mckoi.database.interpret.Statement.resolveVariableName(
at com.mckoi.database.interpret.Statement.resolveExpression(
at com.mckoi.database.interpret.Insert.prepare( :192)
at com.mckoi.database.interpret.SQLQueryExecutor.execute(
at com.mckoi.database.jdbcserver.AbstractJDBCDatabaseInterface.execQuery(
at com.mckoi.database.jdbcserver.JDBCDatabaseInterface.execQuery (
at com.mckoi.database.jdbc.MConnection.executeQuery(
at com.mckoi.database.jdbc.MConnection.executeQueries(
at com.mckoi.database.jdbc.MStatement.executeQueries (
at com.mckoi.database.jdbc.MStatement.executeQuery(
at com.mckoi.database.jdbc.MStatement.executeUpdate(
at foo.MemberBean.addMember( :96)
at org.apache.jsp.registerMember_jsp._jspService(org.apache.jsp.registerMember_jsp:101)
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service( :802)
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service (
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter (
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke (
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection (
at org.apache.tomcat.util.threads.ThreadPool$
at (


Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
You need to add single quotes to a column of VARCHAR,VARCHAR2 or CHAR type.
For ex:

Insert into table(col1,col2,col3) values ('val1','val2',val3);

Still if you get the error, try to copy the query from logs and execute in SQL prompt separately, then it will give you specific SQL Error.

Susie Biddulph

Joined: Jul 06, 2005
Posts: 2

thank you so much.

It was of course the single quotes - you have a keen eye!

My code works beautifully now,

Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
You Are welcome Susie!!
I agree. Here's the link:
subject: MKoi database error - reads values when looking for column headings
Similar Threads
java.sql.DataTruncation: Data truncation
Servlet Exeption error
Regarding a Communication Link Failure Error
java.sql.SQLException: General error
preparedstatement throws sqlexception