Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7948375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:42:19+00:00 2026-06-04T01:42:19+00:00

For my current project I have to use HSQL-JDO. I am writting sample application

  • 0

For my current project I have to use HSQL-JDO. I am writting sample application to check how this work. If I am using HSQL with jdbc (without any orm) my code run fine. But with JDO I am getting “socket creation error”


[Server@187a84e4]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@187a84e4]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@187a84e4]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@187a84e4]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@187a84e4]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@187a84e4]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@187a84e4]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@187a84e4]: [Thread[main,5,main]]: checkRunning(false) exited
JdbcOdbcDriver class loaded
registerDriver: driver[className=sun.jdbc.odbc.JdbcOdbcDriver,sun.jdbc.odbc.JdbcOdbcDriver@a13f991]
DriverManager.initialize: jdbc.drivers = null
JDBC DriverManager initialized
registerDriver: driver[className=org.hsqldb.jdbcDriver,org.hsqldb.jdbcDriver@44e06940]
DriverManager.getConnection("jdbc:hsqldb:hsql://localhost:8974/test_db")
trying driver[className=sun.jdbc.odbc.JdbcOdbcDriver,sun.jdbc.odbc.JdbcOdbcDriver@a13f991]
*Driver.connect (jdbc:hsqldb:hsql://localhost:8974/test_db)
trying driver[className=org.hsqldb.jdbcDriver,org.hsqldb.jdbcDriver@44e06940]
SQLState(08000) vendor code(-80)
java.sql.SQLException: socket creation error
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:78)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1158)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:444)
at org.datanucleus.store.rdbms.RDBMSStoreManager.(RDBMSStoreManager.java:264)

Here is the code in main

Server server = new Server();
server.setAddress("localhost");
server.setDatabaseName(0, "test_db");
server.setDatabasePath(0, "test_db");
server.setPort(8974);
server.setTrace(true);

    Properties properties = new Properties();
    properties.setProperty("javax.jdo.PersistenceManagerFactoryClass","org.datanucleus.api.jdo.JDOPersistenceManagerFactory");
    properties.setProperty("javax.jdo.option.ConnectionDriverName","org.hsqldb.jdbcDriver");
    properties.setProperty("javax.jdo.option.ConnectionURL","jdbc:hsqldb:hsql://localhost:8974/test_db");
    properties.setProperty("javax.jdo.option.ConnectionUserName","SA");
    properties.setProperty("javax.jdo.option.ConnectionPassword","");
    properties.setProperty("javax.jdo.option.ConnectionPassword","");

    properties.setProperty("datanucleus.autoCreateSchema","true");
    properties.setProperty("datanucleus.validateTables","false");
    properties.setProperty("datanucleus.validateConstraints","false");

    PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(properties);

    PersistenceManager pm = pmf.getPersistenceManager();
    Transaction tx=pm.currentTransaction();

    tx.begin();
    pm.makePersistent(new Session("aniruddha"));
    tx.commit();

    Query q = pm.newQuery("SELECT FROM "+Session.class.getName());

    List<Session> sessions = (List<Session>)q.execute();
    //Iterator<Session> iter = sessions.iterator();

    for(Session s : sessions){
        System.out.println(s.getSESSION_ID()+" : "+s.getSESSION_USERNAME());
    }

Here is the bean that I want to persist


@PersistenceCapable
public class Session {
private Session(){
// Default constructor required by jdo
}
public Session(String session_username){
SESSION_USERNAME = session_username;
}

public long getSESSION_ID() {
    return SESSION_ID;
}
public String getSESSION_USERNAME() {
    return SESSION_USERNAME;
}
public void setSESSION_ID(long sESSION_ID) {
    SESSION_ID = sESSION_ID;
}
public void setSESSION_USERNAME(String sESSION_USERNAME) {
    SESSION_USERNAME = sESSION_USERNAME;
}


@PrimaryKey
@Persistent(valueStrategy=IdGeneratorStrategy.INCREMENT)
private long SESSION_ID;
private String SESSION_USERNAME;

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:42:20+00:00Added an answer on June 4, 2026 at 1:42 am

    If server mode doesn’t work then you haven’t started the HSQLDB server. Works for me with either form, either URL or file. I start a server from the command line exactly as per the HSQLDB docs.

    With your API calls for Server, you seem to be missing calling “server.start()”. Either way the problem is in HSQLDB server startup, not DataNucleus access.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a short question. Im my current project I'm using LINQ-to-SQl. That is
I'm considering using Grails for my current project. I have a couple of requirements
In my current project we have to develop a good looking desktop based application
I have project in which I want to use check library for unit testing.
I usually use Nunit but in my current project I am using MSTest. Now
I'm working on a project that i have to use ruby 1.8.7. I'm using
Our current project does not use Hibernate (for various reasons) and we are using
In the current project we have decided to use dto's to transfer data between
Because of specifics of my current project, I have to keep using .NET 2.0.
In my current project I have to decide which technique to use when branching.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.