Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MKoi database error - reads values when looking for column headings

Susie Biddulph
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You Are welcome Susie!!
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!