Swing models and SQL Server 2000

Hi, I want to connect Swing components with SQL Server 2000 throug the Sun One Studio models for Swing (Connection Source, NBJdbcRowset and so on) but I'm failing. I think it could be the JDBC (I'm using jTDS). I wanted to know if someone has succeded with another JDBC or if someone know why my code is not working.
Here is the code:
conSourcePais = new org.netbeans.lib.sql.ConnectionSource();
try {
jdbcRowsetPais = new org.netbeans.lib.sql.NBJdbcRowSet();
} catch (java.sql.SQLException e1) {
e1.printStackTrace();
conSourcePais.setDatabase("jdbc:jtds:sqlserver://federico:1433/BalSocial"; );
conSourcePais.setDriver("net.sourceforge.jtds.jdbc.Driver");
conSourcePais.setPassword("027cefdffb7d3f1b278a899fbcc2eb192b446994ae122a07a710ab0c0c5cc829d0", true);
conSourcePais.setUsername("Programa");
jdbcRowsetPais.setCommand("select * from pais");
jdbcRowsetPais.setConnectionSource(conSourcePais); //when it executes this command next line shows up on process output.
//JdbcRowSet (setTypeMap): The Connection.setTypeMap(Map) method is not implemented.
//code continues executing
jComboBoxPais = new javax.swing.JComboBox();
jComboBoxPais.setEditable(true);
jComboBoxPais.setModel(new org.netbeans.lib.sql.models.ComboBoxModel (jdbcRowsetPais, "Descripcion", null, null, null));
try {
String nuevoPais = (String) jComboBoxPais.getSelectedItem();
jdbcRowsetPais.last();
String nuevoID = jdbcRowsetPais.getString("cod_pais");
nuevoID = String.valueOf(Integer.parseInt(nuevoID) + 1);
jdbcRowsetPais.moveToInsertRow(); //here raises an exception
jdbcRowsetPais.updateString("cod_pais", nuevoID);
jdbcRowsetPais.updateString("descripcion", nuevoPais);
jdbcRowsetPais.insertRow();
} catch(SQLException e) {e.printStackTrace();}
StackTrace:
java.sql.SQLException: ResultSet is read only.
at net.sourceforge.jtds.jdbc.JtdsResultSet.checkUpdateable(JtdsResultSet.java:310)
at net.sourceforge.jtds.jdbc.MSCursorResultSet.moveToInsertRow(MSCursorResultSet.java:983)
at sun.jdbc.rowset.JdbcRowSet.moveToInsertRow(JdbcRowSet.java:2658)
at JIntFrameLocalidad.jButtonAgPaisActionPerformed(JIntFrameLocalidad.java:229)
at JIntFrameLocalidad.access$100(JIntFrameLocalidad.java:15)
at JIntFrameLocalidad$2.actionPerformed(JIntFrameLocalidad.java:134)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

See the javadoc for Connection.createStatement(int resultSetType, int resultSetConcurrency). You need to pass ResultSet.CONCUR_UPDATABLE for the second argument in order to get a result set that you can modify.

Similar Messages

  • JDBC Connection between Unix and SQL Server 2000

    I have SQL Server 2000 installed in a pc as a data server and SQL Server 2000 JDBC Drive installed in a Unix machine. Both machines are connected and can ping each other. After setting up the environment data, I ran a test code to test the connection and got exceptions. ( I did the same process between a pc and the data server, it works well.)
    Attached are the test code and error message. Hope someone can help me.
    ******* Test Code ********
    import java.sql.*;
    * Microsoft SQL Server JDBC test program
    public class Test {
    public Test() throws Exception {
    // Get connection
    DriverManager.registerDriver(new
    com.microsoft.jdbc.sqlserver.SQLServerDriver());
    Connection connection = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://<hostname>","<username>","<password>");
    if (connection != null) {
    System.out.println();
    System.out.println("Successfully connected");
    System.out.println();
    // Meta data
    DatabaseMetaData meta = connection.getMetaData();
    System.out.println("\nDriver Information");
    System.out.println("Driver Name: "
    + meta.getDriverName());
    System.out.println("Driver Version: "
    + meta.getDriverVersion());
    System.out.println("\nDatabase Information ");
    System.out.println("Database Name: "
    + meta.getDatabaseProductName());
    System.out.println("Database Version: "+
    meta.getDatabaseProductVersion());
    } // Test
    public static void main (String args[]) throws Exception {
    Test test = new Test();
    ******* error message ********
    Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:64)
    at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
    at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
    at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
    at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
    at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:137)
    at Test.<init>(Test.java:10)
    at Test.main(Test.java:32)
    ************ end of message ***********

    If it works from a PC and not from the Unix box then you may have a network issue of some sort, I.E. firewall not letting it through etc.
    Try using telnet on the Unix box to see if you can connect to the sql server on the port that the SQL server is listening.
    E.G.
    telnet server_name 1433
    You may need to change the port number to the one that the SQL server is using.
    Col

  • Sap4.7 and sql server 2000 on windows2003:when install di ,error:MDB-05039

    sap4.7 and sql server 2000 on windows2003:
    when install database instance ,there is a error,at change  tempdb
      MDB-05039:Unable to stop server dev ,
    please help !!!!

    Every time you start SQL Server it also creates a new tempdb. When you change the layout (physical structure, size) you have to restart SQL Server in order for these changes to take effect.
    It seems that the installation routine has changed the layout (it does that according to your input!) and is now trying to stop and restart SQL Server. When you run into this error, have you tried to stop and restart SQL Server manually? After that choose the Retry option of the installation routine. Just a guess...
    Do you have some more log information?
    Sven

  • HELP: Reports Builder 9iDS Rel2 and SQL Server 2000

    Hi,
    I need to connect to a SQL Server 2000 database from within Report Builder (for a proof of concept) and I am getting error 62000-Failed to connect to datasource.
    Can you help?
    My OS is Windows Prof 2000.
    I have Downloaded Oracle 9iDS Rel2 and Oracle 9i AS J2EE and Web Cache. They are installed in the same Oracle Home.
    I have modified the REPORTS_CLASSPATH with the datadirect jar files and the j2ee oc4j.jar.
    The oc4j.jar is in my system classpath.
    I have added the classpath definition with jars to my rwserver.conf.
    I start Report Builder select JDBC Query
    enter my connect info:
    Username: user
    Passowrd: pwd
    Database: dbname
    and select the merant-sqlserver driver from the list.
    What am I doing wrong?
    I have been at this a week can anyone help?
    Thanks.

    Hi Jeanne
    1. When you run the report to paper design from builder, you need to add the necessary jar file of driver to REPORTS_CLASSPATH env variable in registery.
    2. To run the report from report server and to generate to file from report builder, you need to add the jar files via classPath attribute of engine element in server/builder conf file. It would be like this
    <engine id="rwEng" .....classPath="<yr classpath>" >
    3. Have a look at jdbcpds.conf file in OH/reports/conf dir. This file need to have the driver information for the driver you are using. The entry here also specifies the connect sting format which is required by the driver. You need to refer to driver doc for connect string format.
    Once you have all this set up ready, run the report. You need to mention the connect string in same format as specified in driver info in jdbcpds.conf file.
    Try this.
    Thanks
    Rohit

  • Reports Builder 9iDS Rel2 and SQL Server 2000

    Hi,
    I need to connect to a SQL Server 2000 database from within Report Builder (for a proof of concept) and I am getting error 62000-Failed to connect to datasource.
    Can you help?
    My OS is Windows Prof 2000.
    I have Downloaded Oracle 9iDS Rel2 and Oracle 9i AS J2EE and Web Cache. They are installed in the sale Oracle Home.
    I have modified the REPORTS_CLASSPATH with the datadirect jar files and the j2ee oc4j.jar.
    I have added the classpath definition with jars to my rwserver.conf.
    I start Report Builder select JDBC Query
    enter my connect info:
    Username: user
    Passowrd: pwd
    Database: dbname
    and select the merant-sqlserver driver from the list.
    What am I doing wrong?
    I have been at this a week can anyone help?
    Thanks.

    You should ask this on the Reports discussion forum, you'll get a better answer there.
    http://forums.oracle.com/forums/index.jsp?cat=19

  • Transfering information between Oracle 8 and SQL Server 2000

    I want to transfer some of the data stored in 4 different tables in my Oracle database and easy as possible to my SQL Server 2000 database. I found the import option in SQL2k which uses ODBCconnection to the Oracle but it needs the migration suit as far as I know. At the downloadarea there are only plug-ins for SQL Server 7 but not 2000.
    Am I even on the right track or is there any other way of accomplishing this?

    is there any known problem if I install Oracle 10g EE
    on the same machine where Sql Server 2000 EE is
    install?It's presently undocumented, but some of the ORACLE.EXE process threads are known to get stuck in an infinite loop whenever a SQL Server database is running on the same box. The infinite loops cause the SQL Server database to eventually shutdown, and then the loops are broken and Oracle returns to normal. Stack traces have revealed something like this, which would suggest that the Oracle process is actually communicating with SQL Server:
    Oracle:  laughAtGirlieDatabase()  /* infinite loop */
    SQL:     exit();-)

  • Using Report Creator and SQL Server 2000

    I am attempting to make some prompts and such using the report designer, and after connecting to my SQL Server 2000 DBMS using the SQL native Client as nothing else works, when i try to make a prompt based of a DB field, it does not populate... also when I verify the database it says that it cannot find the tables, but if I put one of the fields on the report, the data is displayed, I can also browse the data while creating the report as well...
    Any ideas how to fix this?
    Josh Fink
    [email protected]

    Add the tables and then remove those that are not required. Knowledge of the database is required.

  • Jtds and SQL server 2000(Personal Edition) problem

    My application need to work in standalone mode without being connected to the network.
    I've installed SQL Server 2000(Personal Edition) on Windows XP platform. I've Tomat 4.1 installed on the same machine. My applciation based on jsps and servlets runs on the same machine.
    I'm using the jtds driver and I use the following code to connect to SQL Server.
    Class.forName("net.sourceforge.jtds.jdbc.Driver");
    String str="jdbc:jtds:sqlserver://127.0.0.1/GH;tds=8.0;namedpipe=true;lastupdatecount=true";
    It works fine as long as the machine is connected to the network. Once it is unplugged, it gives me the error "ArrayIndexOutofBounds Exception-1".
    But my application needs to be run on a machine where there is no network at all. In the above string I tried to change 127.0.0.1 by computer name and removed namedpipe parameter.
    str="jdbc:jtds:sqlserver://mypctds=8.0;lastupdatecount=true";
    But it gives the same error. Any idea on this?

    Infact SQl server is not listening to 1433 port. When I telnet localhost 1433, it is not connecting. I checked up Server N/w utility and Client N/w utility, both TCP and Named Pipe are enabled. Only if I include namedPipe=true, it works and it requires network connection to be present.
    Under Server network utility, if I choose named pipe, the default value shows \\.\pipe\sql\query. I tried to remove \\ so that it doesn't take the network path. But it doesnot work. ANy help?

  • Discoverer 4.1 and sql server 2000

    Hi,
    I am having difficulty creating an EUL using discover41
    againstr SQL Server 2000. I have created an ODBC source
    which i can connect to and Discoverer Administrator
    starts to create the EUL but always fails at the end
    giving the error:
    Creating tables and views...
    Populating tables with default data...
    Install failed, cause : [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'suid'
    can anyone help?
    Also if i create the EUL in Oracle and then connect
    to Administrator then create a new Business Area and then
    select the database as a database link i've created.
    I select the sql server user and select the tables
    but as it tries to import them i get the following error:
    ORA-03113: end-of-file on communication channel.
    can anyone help with this to?
    thank you,
    Jonathan.

    Hi,
    here is the link to the 'compatibility pages'  for BI 4.1 http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/507d3365-009b-3010-04b0-e5abc8f00c91?QuickLink=index&…
    you want the slide 'data access' , then click on the button 'Semantic Layer Datasources' to view the lookup matrix
    without looking, I would say SQL 2000 isn't compatible / officially supported
    regards,
    H

  • Crystal Reports and SQL Server 2000

    Hi all,
    I read the document "Troubleshooting Database Connectivity for Crystal Reports" and tried all SQL Server jdbc drivers (1.2, 2.0,2.0.1, 3) and I could not find  a working driver with crystal reports at all.
    http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/d05b3bb7-0f28-2c10-4ea3-84dbdc4e414e?quicklink=index&overridelayout=true
    I'm also not sure if there is a working one?
    Are there anybody who suggest me a jdbc driver for SQL server which also supports Crystal Reports?
    The connection is ok, but the problem is I don't see tables and other staff under the connection...According to the document above, this means the driver does not support crystal reports...
    Product versions which involve this issue as follows:
    SQL Server 2000
    JRE 5.0
    Crystal Reports 11.8 (Comes with IBM RAD 7.5 IDE)
    Platform : IBM Portal 6.1.0.2 ( IBM Websphere App. Server 6.1)
    Any help would deeply be appreciated.
    I'm totaly exhausted. I hope someone help me...
    Best regards,
    E.

    I gave up this issue since I learnt that Crystal Java Reporting Component does not support portlet.  I also tried with SQL 2008 and I also updated my IDE for updating Crystal plug-in in it.  It was finally working at portal but the pager buttons and other staff in the viewer were not working since it  still does not support portlet.
    Thanks a lot.
    E.

  • ODBC errors for Oracle Migration Workbench and SQL Server 2000 on Windows

    Hi all-
    I setup a new ODBC connection for the Oracle 10g Migration Workbench to MS SQL Server 2000 on Windows XP and keep getting the following errors when I try to
    either test the new ODBC connection to MS SQL Server 2000 for use with the Oracle Migration Workbench tool. Goal is to fix these errors so that I can migrate our test SQL Server 2000 databases to Oracle 10g.
    Current configuration
    - Oracle 10.1 Migration Workbench
    - Oracle 10g Database (target)
    - MS SQL Server 2000 (source database)
    -Windows XP
    -ODBC 3.85.1117 driver for Windows XP with SQL Server and Oracle
    Errors:
    I. When I test the ODBC connection:
    Microsoft SQL Server ODBC Driver Version 03.85.1117
    Running connectivity tests...
    Attempting connection
    [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Specified SQL server not found.
    TESTS FAILED!
    Now here is what has me totally confused:
    I can use the command line ISQL to access the database on the server and IP is all correct and port is available. So I can access the SQL Server database fine it is when I try to setup ODBC that it gives me problems.
    Any tips how to get this ODBC working?
    Thanks
    Ben Prusinski

    1. Jing Jin. If you had READ the post you would have seen that installing later versions is NOT an option.
    2. Not supported does NOT mean does NOT work, as Balmukund pointed out in the referenced thread.  The site that this databases supports is using ASP which is also NOT supported by Microsoft.  As it turns out Balmukund's solution actually turns
    out to be the correct solution.  I installed SS2K and its Service pack 4 on the machine last night.  Good answer Balmukund. as we say in the Navy, "BRAVO ZULU!!"  which means "WELL DONE!!
    3. Tom Li I just posted the question less than 48 hours ago.  My last post was less than 24 hours ago.  I think I have the right to be given the opportunity to determine whether a reply is the answer or not. I understand you don't like unanswered
    posts sitting around for weeks, months or years. (I don't like it either as I have a few that are still unanswered after several years.)  But you should not be showing replies as answers before I even get a chance to see them, much less try them out. 
    You should also not be showing replies as answers which don't address the criteria of the question.  I specifically stated that I had to install SS2K.  I went on to state, "And before anyone asks I need to install this version because that is what
    the customer is using and I need to duplicate their databases."  So the correct answer, if in fact SS2K did not work on Windows 7, would have been a virtual machine answer, as suggested on the thread Balmukund referenced.  So before you mark a reply
    as an answer read the question.
    Edward R. Joell MCSD MCDBA

  • Oracle 6i and SQL Server 2000

    We are trying to get Oracle 6i to work via ODBC with SQL Server 2000. We get it to login, but can't get it to do anything else.
    Any ideas? (I can be reached at [email protected])

    dev2000 , 6 and 6i can run with other database i.e db2 , MS Sql by using odbc to connect with database .
    1. create odbc for yuoer database .
    2. your oracle must install OCA (Oracle client Adapter ) that come with CD install form
    3. test connect with sqlplus like this
    user_name/pwd@odbc:odbc
    4. use this connect in your form
    5. finished.
    sometime i have problem with 6i . i cannot connect so i have to copy file UB80*.dll from CD install 6 and replace in 6i
    then i can connect database ... please try ...

  • Eclipse jtDS and Sql Server 2000

    Hi everyone,
    i use eclipse 2.1 as ide and ms sql server 2000 as database server. But i couldnt connect mssql server with jtds.
    where shall i put the .jar with jtds comes? Which settings shall i do?
    Thanks a lot...

    There should be WEB-INF directory under each web application( project in eclipse).
    expand the project and expand WEB-INF directory, you will see lib directory.
    If lib directory does not exist,create one lib directory as it wll be automatically included in CLASSPATH on starting the ap server.
    then keep teh jtds jar file in the lib directory.
    Cheers
    Varma Dandu.

  • DBCO and SQL Server 2000...

    Hi all,
         How to configure the SQL server connection in DBCO transaction. SQL Server is not residing in the same machine.  The R/3 version is ECC 5.0 in <b>IBM AIX environment</b>.
    Regards
    Vasu

    Hi Vasu. I'm currently making some test on this, connecting to a SQL Server Database with our SAP ECC 5.0 system on an AIX architecture.
    The only way i've found, so far, is to make use of RFC enabled functions, on this RFC we use the EXEC SQL CONNECT statement, the thing is that this RFC should run on an app server that HAS to be on WINDOWS.
    You may wanna check note 178949.
    Hope it Helps.
    Jesus

  • Creating Oracle Model of SQL Server 2000 Model

    Hi,
    I have encountered couple of T-SQL where such case statements are resides stated below. I have found out that when I erased the distinct, it was parsed correctly by the OMWB. What may be the cause of this. Any comments?
    CASE [MONTH](dbo.recetat.dtEkzekutimit) WHEN dbo.muajt.[id] THEN (count (distinct (CASE (dbo.Recetat.KodPacienti) WHEN '0' THEN convert(nvarchar(50),0) ELSE dbo.Recetat.KodPacienti END)) ) ELSE 0 END AS NrPacient

    Hi,
    Im afraid this is a bug with our current parser.
    I have logged a bug against it (bug 5498754)
    We are currently redeveloping our migration tools see here
    http://www.oracle.com/technology/tech/migration/migrationtoolsstatementofdirection.htm
    Thanks for working out that it was the DISTINCT function which caused the problem.
    Im afraid your workarond of removing the DISTINCT from the T_SQL, Parsing to PL/SQL and then manually adding back in your DISTINCT is the only workaround available.
    Regards,
    Dermot.

Maybe you are looking for

  • R/3 APO Integration: Enhanced Fields not transferred

    Hi, My requirement is when I change the value of an enhanced field in a material in MM02 in R/3, the change should be reflected in the corresponding product in APO. I want to enhance the Material Master in R/3 and APO with a Z field. I have done this

  • Basic iPhoto questions:

    I have some Basic iPhoto questions before I start using the program: - does iPhoto apply any compression or change images in any way when they are imported? - after images are imported, can the original source folder of images be deleted off of the m

  • How can I use Internet explorer in my iMac

    I have some applications that require internet explorer which I cannot use in my iMac. Is it possible to do this ??

  • Not able to remove items from initiative

    Hello All, We are on PPM 5.0 and I am trying to remove added items from the 'initiative' but I am not able to remove them. Can someone kindly help, as to what might be preventing from removing items from initiatives. Thanks, Sachin

  • AirPort WiFi on 2010 MBA won't stay connected to 5Ghz band since latest 10.6.7 update.

    I updated my 2010 MBA 11" to the latest/greatest of everything in prep for Lion. So, I now have 10.6.7 of course. But ever since the updates, I noticed that my wifi on the MBA won't stay connected to the 5 Ghz band of my router. It'll connect fine to