Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9488

Re: looking for a simple JAVA code to attach to SQL via ODBC

From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: looking for a simple JAVA code to attach to SQL via ODBC
Date 2011-11-03 18:06 -0700
Organization http://groups.google.com
Message-ID <11320388.182.1320368767789.JavaMail.geo-discussion-forums@prev11> (permalink)
References <88b3745a-8824-4863-b97e-f793b571b966@m19g2000yqh.googlegroups.com> <31728236.280.1320353657204.JavaMail.geo-discussion-forums@prgt40> <4eb30125$0$289$14726298@news.sunsite.dk>

Show all headers | View raw


On Thursday, November 3, 2011 2:01:24 PM UTC-7, Arne Vajhøj wrote:
> On 11/3/2011 4:54 PM, Lew wrote:
> > On Thursday, November 3, 2011 1:04:41 PM UTC-7, eAddict wrote:
> >> First, a bit of background.  I am trying to get UDConnect (a SAP
> >> product) to work.  This requires a JAVA connection from the HP-UX
> >> system to a MS SQL server using an ODBC driver.
> >
> > You want to avoid connecting to the DBMS via ODBC.  Use JDBC (Java DataBase Connectivity) or, better yet, JPA (Java Persistence API).  EclipseLink and Apache OpenJPA are two good JPA implementations.
> >
> >> I looked at the MS knowledge base (http://support.microsoft.com/kb/
> >> 313100) to see some sample code.  Well, this sample is good if going
> >> from a MS system to another MS system.
> >
> > You're talking about Java.  Microsoft will not be your best source of information about Java.
> >
> > IBM Developerworks and the Oracle Java pages are your best initial source.
> >
> >> Problem is I don't know/code Java.  I would like to have a simple java
> >> program on my HP-UX system that tests the ODBC connection the same way
> >> the MS example does.
> >>
> >> Anyone have a sample they can share?
> >
> > Mostly Java programs do not use ODBC.  In the rare cases where they do, it's ugly.  It's much better to connect directly to the database through Java than to go through yet another intermediate layer.
> 
> The link is using JDBC and not via the JDBC ODBC bridge.

And the OP asked for ODBC.  I was responding to his question, not to the link.

> And direct JDBC is probbaly better than JPA for testing connectivity!

If that's all you're doing, sure.  Couldn't agree more.

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

looking for a simple JAVA code to attach to SQL via ODBC eAddict <eaddict@gmail.com> - 2011-11-03 13:04 -0700
  Re: looking for a simple JAVA code to attach to SQL via ODBC Lew <lewbloch@gmail.com> - 2011-11-03 13:54 -0700
    Re: looking for a simple JAVA code to attach to SQL via ODBC Arne Vajhøj <arne@vajhoej.dk> - 2011-11-03 17:01 -0400
      Re: looking for a simple JAVA code to attach to SQL via ODBC Lew <lewbloch@gmail.com> - 2011-11-03 18:06 -0700
        Re: looking for a simple JAVA code to attach to SQL via ODBC Arne Vajhøj <arne@vajhoej.dk> - 2011-11-03 22:28 -0400
    Re: looking for a simple JAVA code to attach to SQL via ODBC Roedy Green <see_website@mindprod.com.invalid> - 2011-11-04 15:53 -0700
  Re: looking for a simple JAVA code to attach to SQL via ODBC Arne Vajhøj <arne@vajhoej.dk> - 2011-11-03 16:59 -0400
  Re: looking for a simple JAVA code to attach to SQL via ODBC Roedy Green <see_website@mindprod.com.invalid> - 2011-11-03 22:07 -0700
    Re: looking for a simple JAVA code to attach to SQL via ODBC Arne Vajhøj <arne@vajhoej.dk> - 2011-11-04 21:45 -0400

csiph-web