How to connect to SQL Server through proxy server

196

This article seems specific to MS ISA servers, but the theory may hold.

2008

http://msdn.microsoft.com/en-us/library/ms190801.aspx

2005

http://msdn.microsoft.com/en-us/library/ms190801(SQL.90).aspx


edit:

Perhaps a sql 2005 web service would fit your needs? http://technet.microsoft.com/en-us/library/ms345140(SQL.90).aspx

It won't give you normal odbc functionality though. You shouldn't be exposing your SQL server to the internet btw.

Also, see comment.

Share:
196
Seth Falco
Author by

Seth Falco

Updated on June 14, 2022

Comments

  • Seth Falco
    Seth Falco almost 2 years

    I'm working on the database portion of a project which uses DeltaSpike and Hibernate in Java SE.

    All SELECT statements work, however no INSERT statements appear in the database. There is no warning, error, or exception.

    I've gone through the logs for Hibernate and found the following:

    [DEBUG] [05/05 00:52:16] [org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl] JDBC transaction marked for rollback-only
    

    I've tried adding the @Transactional annotation from javax.transaction and org.apache.deltaspike.jpa.api.transaction, as well as changing the autocommit setting in persistence.xml.

    How can I get this to stop trying to roll back the transaction?

    persistence.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/persistence"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
      <persistence-unit name="primary">
        <properties>
          <property name="hibernate.connection.autocommit" value="false"/>
          <property name="hibernate.hbm2ddl.auto" value="validate"/>
          <!-- Omitted for Brevity -->
        </properties>
      </persistence-unit>
    </persistence>
    

    ExampleRepository.java

    @Repository(forEntity = ExampleData.class)
    public interface ExampleRepository extends EntityRepository<ExampleData, Long> {
    
    }
    

    ExampleListener.java

    @Singleton
    public class ExampleListener extends ExampleAdapter {
    
        private final ExampleRepository emoteRepo;
    
        @Inject
        public ExampleListener(ExampleRepository exampleRepo) {
            this.exampleRepo = Objects.requireNonNull(exampleRepo);
        }
    
        @Override
        public void onExample(ExampleEvent event) {
                // Omitted for Brevity
    
                ExampleData exampleData = new ExampleData(exampleId, parentId);
                exampleRepo.save(exampleData);
            }
        }
    }
    
    • Andreas
      Andreas about 4 years
      Where did you try adding the @Transactional annotation? Edit the question and show what you tried, so we can better help you figure out what you did wrong. --- Also, where is EmoteListener called from?
  • begray
    begray about 15 years
    Thanks. But I've got different situation here, SQLSERVER is public server on the Internet, and I'm going to Internet through http proxy server. Also it'd be great to connect with minimum (none) modifications to proxy configuration.
  • Sam
    Sam over 9 years
    Nobody said to expose your SQL server to the public. I said not to in the answer. The articles I link to note you can restrict connections to certain clients.